Benchmark app to compare speed of CRUD operations of different android database management systems.
Test are executed with a collection of 10000 objects. Execution times are averaged between 10 runs. Tests were run on the Nexus 5X.
-
create(data: List<T>)
Inserts list of objects into database. -
read(): List<T>
Reads all objects from the database. Read is coupled with access to prevent lazy query results (Realm). -
update(data: List<T>)
Updates objects in the database with data of provided objects. -
delete(data: List<T>)
Delete provided objects from the database.
data class Person (
var id: Long,
var firstName: String,
var secondName: String,
var age: Int
)
Library | create | read | update | delete |
---|---|---|---|---|
SQLite | 926 | 234 | 1617 | 1065 |
GreenDAO | 582 | 104 | 698 | 329 |
Room | 566 | 204 | 646 | 289 |
Realm | 463 | 328 | 269 | 920 |
SQLiteBatched | 233 | 229 | 287 | 93 |
ObjectBox | 129 | 183 | 139 | 63 |