Operation-by-Operation
SQLite uses a WITHOUT ROWID table with a BLOB primary key — the fairest possible comparison. Both share identical page cache, WAL, and sync settings. All differences are purely the SQL layer cost.
80% read / 20% write
1K rows per transaction
Methodology
- Dataset: 1,000,000 records, 16-byte random keys, 100-byte values
- Runs: 3 independent runs on a fresh database file; best time reported
- Config: WAL journal mode,
synchronous=NORMAL, 2000-page (8 MB) page cache, 4096-byte pages — identical for both engines - SQLite schema:
CREATE TABLE kv (k BLOB PRIMARY KEY, v BLOB) WITHOUT ROWID— single B-tree keyed on the same field, prepared statements for all DML - Peak memory: Both SNKV and SQLite use ~10.8 MB RSS — they share the same pager and page cache infrastructure
- Platform: Linux x86-64, NVMe storage
Why SNKV Is Faster
SNKV and SQLite use the same B-tree storage engine at the bottom. Every performance difference comes from what each layer adds on top of it.
UPDATE or DELETE statement. SNKV is a direct B-tree seek + in-place write.Run It Yourself
Both benchmarks are open source. Clone and build to reproduce results on your hardware.
C benchmark — SNKV
# From the SNKV repo root
make test
./tests/test_benchmark
C benchmark — SQLite comparison
# https://github.com/hash-anu/sqllite-benchmark-kv
git clone https://github.com/hash-anu/sqllite-benchmark-kv
cd sqllite-benchmark-kv
make
./sqlite_benchmark
Python benchmark — SNKV vs diskcache
# From the SNKV repo root
pip install diskcache snkv
python python/examples/benchmark_diskcache.py
Additional comparisons against LMDB and RocksDB:
LMDB — github.com/hash-anu/lmdb-benchmark
RocksDB — github.com/hash-anu/rocksdb-benchmark