Three things that make benchmarks lie
Almost every casual SQLite benchmark on the internet is wrong in at least one of these ways. Avoid them in your own measurements.
- Cold vs warm cache — the first run reads from disk; subsequent runs hit OS page cache. Decide which case you're measuring and warm/cool deliberately.
- Per-statement transactions — autocommit writes one fsync per row. A loop of 10k INSERTs with no transaction is not measuring SQLite's write speed; it's measuring your filesystem's sync latency.
- Tiny dataset — every database is fast on 100 rows. Measure with realistic row counts; ideally a multiple of your expected production scale.
Principle: A benchmark that doesn't say which PRAGMAs were set, what the dataset shape was, and whether the cache was warm is not a benchmark. Always document those three things.