A simple benchmark of performance for GRDB.swift (sqlite) and Realm
pod install then use XCode's test function to run the benchmark
Tasks in this benchmark manipulate a sample data record type modeling a realistic situation.
Insert 100000 entries into the database. This models preloading of massive dataset for subsequent offline use.
Fetch by Id
Fetch 10000 record from database by random id. This models typical app operations, in which the id of record is already known by some way (e.g. from server).
Query by info
Fetch records that contains specific keyword in some fields from database. This models a search query in the offline dataset.
|Batch insert||3.513 sec||3.782 sec||-|
|Fetch by Id||2.973 sec||0.580 sec||0.646 sec|
|Query by info||0.450 sec||3.564 sec||-|