Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
db-benchmark.xcodeproj
db-benchmark.xcworkspace
db-benchmark
db-benchmarkTests
.gitignore
Podfile
Podfile.lock
README.md

README.md

DB benchmark

A simple benchmark of performance for GRDB.swift (sqlite) and Realm

Running benchmark

pod install then use XCode's test function to run the benchmark

Tasks

Tasks in this benchmark manipulate a sample data record type modeling a realistic situation.

Batch insert

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.

Result

Task GRDB.swift Realm GRDB.swift (optimized)
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 -
You can’t perform that action at this time.