Benchmarks: SQLite, redb and Oxigraph
tiramemsu 0.8.1 on SQLite (with and without its LFTJ operator) and on redb, against Oxigraph 0.5 on RocksDB, the reference Rust RDF store. Same generated data, same queries, every answer compared across engines before anything is timed. The losses are on this page too.
Worst-case-optimal joins
A triangle through hubs at 10⁶ statements: 20.76 ms on redb, 29.00 ms on SQLite with LFTJ, 4.87 s on SQLite's own plan and 55.35 s on Oxigraph.
Chains, stars and Cypher
The snowflake F1 at 10⁶: 20.22 ms on redb, 23.17 ms on SQLite, 179.34 ms on Oxigraph. A Cypher two-hop from a property map: 379 µs on redb, 14.44 ms on SQLite.
Concurrent lookups
Two-hop lookups per second on 16 threads at 10⁶: 67 577 on Oxigraph, 49 496 on redb, 15 897 on SQLite, whose reader pool tops out early.
Transactions cost time
One insert at 10⁵: 5 µs on Oxigraph against 111 µs on SQLite and 120 µs on redb. Bulk load of a million statements: 2.0 s, 51 s and 89 s.
Read these numbers with our priorities
- Transactions before speed. Every tiramemsu write is one ACID transaction with a statement id, a transaction number, schema checks, an event, full history and cascading retractions. The write columns compare different amounts of work.
- Durability: both tiramemsu engines run at
Normal(SQLitesynchronous = NORMALwith WAL; redb group commit within 50 ms or 1 000 commits); Oxigraph at its default, RocksDB with its write-ahead log. - Correctness before timing: each query runs once on every engine and the results are compared (counts always, sorted rows up to 1 000); a mismatch stops the run. A query that passes 60 s on its checked run is a timeout and takes no part in that comparison. The cap bounds the checked run only, so a timed median can exceed it.
- What each engine can answer: Oxigraph has no transaction or valid time, no statement ids and no Cypher, so it is left out of the time-view lookups, Cypher, Cypher paths, cascade and supersede (“—”).
Known caveats. At 10⁶ statements only redb answered the skewed diamond and 4-cycle, so those two answers were not cross-checked in this run; the differential tests check the same queries on small graphs. Concurrent readers moved −17 % (4 threads) at 10⁵ and +20 % at 10⁶ against the previous run with no change on their path; read differences of that size as noise between runs.
Results
Medians; the fastest engine of each row is marked. Pick a scale.
1 004 143 statements in the WatDiv-style graph · 5 timed runs per query after one checked run · macos aarch64 · Apple M2 Max · 12 threads · measured 27 October 2026.
Bulk load
Time to load the WatDiv-style graph through each engine's bulk path. Lower is better.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| bulk load | watdiv | 89.07 s | 51.09 s | 2.00 s |
Size on disk
Bytes per statement. Lower is better; redb grows its file in large steps while loading, and tm compact reclaims it.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| after load | watdiv | 287 B | 2 147 B | 78 B | |
| after churn | watdiv | 288 B | 2 147 B | 130 B | |
| after compaction | watdiv | — | 1 051 B | 130 B |
WatDiv-style templates
Linear (L), star (S), snowflake (F) and complex (C) SPARQL queries over a seeded e-commerce graph, with constants chosen to be selective at every scale.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| L1 users in the cities of one country | now | 7320 | 4.01 ms | 4.77 ms | 28.57 ms |
| L2 reviews of products sold in one city | now | 0 | 63 µs | 41 µs | 72 µs |
| L3 what one user's followees like, with genre | now | 9 | 69 µs | 58 µs | 162 µs |
| S1 products of one genre under a price, with seller | now | 1654 | 5.67 ms | 7.63 ms | 37.04 ms |
| S2 users of one city with age and name | now | 1138 | 2.69 ms | 2.70 ms | 12.62 ms |
| S3 5-star reviews of one genre's products, with reviewer | now | 598 | 2.23 ms | 3.84 ms | 195.98 ms |
| F1 snowflake: users in one city → likes → genre, seller → location | now | 10581 | 23.17 ms | 20.22 ms | 179.34 ms |
| F2 good reviews of expensive products in one genre, reviewer's age | now | 1935 | 14.48 ms | 14.29 ms | 74.26 ms |
| C1 reviews per genre (aggregate) | now | 19 | 13.41 ms | 20.72 ms | 400.65 ms |
| C2 mutual follows in the same city (count) | now | 1 | 87.07 ms | 96.17 ms | 602.75 ms |
Lookups in time views
A point lookup and a two-hop lookup in the current view, as of an earlier transaction and at a valid-time instant. Oxigraph has no time views.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| point | now | 10 | 59 µs | 47 µs | 115 µs |
| point | asOf | 10 | 70 µs | 43 µs | — |
| point | validAt | 10 | 69 µs | 52 µs | — |
| 2-hop | now | 9 | 52 µs | 48 µs | 140 µs |
| 2-hop | asOf | 9 | 73 µs | 46 µs | — |
| 2-hop | validAt | 9 | 68 µs | 45 µs | — |
Cypher
The same graph through openCypher. Oxigraph has no Cypher.
| Query | Variant | Rows | SQLite | redb |
|---|---|---|---|---|
| 2-hop | now | 9 | 14.44 ms | 379 µs |
| star | now | 827 | 152.47 ms | 95.12 ms |
| aggregate | now | 19 | 389.70 ms | 372.44 ms |
Paths
SPARQL reachability, and Cypher shortest path and trail.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| reachability | now | 1 | 34.15 ms | 33.33 ms | 107.21 ms |
| shortest | now | 1 | 1.61 s | 3.87 s | — |
| trail 1..3 | now | 1 | 760.08 ms | 1.92 s | — |
Concurrent readers
Two-hop lookups per second from different users on 1, 4 and 16 threads. Higher is better.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| 2-hop | 1 threads | 14 724/s | 18 680/s | 11 700/s | |
| 2-hop | 4 threads | 13 934/s | 36 746/s | 34 344/s | |
| 2-hop | 16 threads | 15 897/s | 49 496/s | 67 577/s |
Writes
One write per transaction. A tiramemsu write allocates a statement id and a transaction number, checks schemas, records an event, keeps history and cascades; an Oxigraph insert adds a quad.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| insert | watdiv | 141 µs | 146 µs | 6 µs | |
| replace (churn) | watdiv | 187 µs | 203 µs | 16 µs | |
| cascade | watdiv | 384 µs | 538 µs | — | |
| supersede | watdiv | 253 µs | 345 µs | — |
Cyclic patterns
Subgraph counts on a uniform random graph and on a hub-and-spoke graph, where binary joins build large intermediate results. LFTJ is tiramemsu's worst-case-optimal operator for SQLite.
| Query | Variant | Rows | SQLite | SQLite + LFTJ | redb | Oxigraph |
|---|---|---|---|---|---|---|
| triangle | uniform | 1 | 923.85 ms | 550.99 ms | 492.07 ms | 7.58 s |
| diamond | uniform | 1 | 3.58 s | 2.24 s | 1.24 s | 36.98 s |
| 4-cycle | uniform | 1 | 3.57 s | 1.30 s | 1.14 s | 38.81 s |
| tailed triangle | uniform | 1 | 882.28 ms | 682.66 ms | 556.29 ms | 7.17 s |
| triangle | skewed | 1 | 4.87 s | 29.00 ms | 20.76 ms | 55.35 s |
| diamond | skewed | 1 | timeout | timeout | 69.26 s | timeout |
| 4-cycle | skewed | 1 | timeout | timeout | 37.62 s | timeout |
| tailed triangle | skewed | 1 | 5.52 s | 35.90 ms | 27.97 ms | 55.79 s |
100 352 statements in the WatDiv-style graph · 5 timed runs per query after one checked run · macos aarch64 · Apple M2 Max · 12 threads · measured 27 October 2026.
Bulk load
Time to load the WatDiv-style graph through each engine's bulk path. Lower is better.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| bulk load | watdiv | 7.10 s | 2.85 s | 0.15 s |
Size on disk
Bytes per statement. Lower is better; redb grows its file in large steps while loading, and tm compact reclaims it.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| after load | watdiv | 384 B | 1 343 B | 79 B | |
| after churn | watdiv | 388 B | 1 343 B | 82 B | |
| after compaction | watdiv | — | 1 056 B | 135 B |
WatDiv-style templates
Linear (L), star (S), snowflake (F) and complex (C) SPARQL queries over a seeded e-commerce graph, with constants chosen to be selective at every scale.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| L1 users in the cities of one country | now | 634 | 402 µs | 403 µs | 1.63 ms |
| L2 reviews of products sold in one city | now | 121 | 166 µs | 148 µs | 481 µs |
| L3 what one user's followees like, with genre | now | 9 | 79 µs | 65 µs | 140 µs |
| S1 products of one genre under a price, with seller | now | 136 | 503 µs | 769 µs | 2.19 ms |
| S2 users of one city with age and name | now | 310 | 490 µs | 687 µs | 2.19 ms |
| S3 5-star reviews of one genre's products, with reviewer | now | 51 | 225 µs | 372 µs | 11.34 ms |
| F1 snowflake: users in one city → likes → genre, seller → location | now | 3874 | 13.90 ms | 6.72 ms | 42.15 ms |
| F2 good reviews of expensive products in one genre, reviewer's age | now | 208 | 1.10 ms | 1.50 ms | 4.86 ms |
| C1 reviews per genre (aggregate) | now | 20 | 1.16 ms | 2.04 ms | 28.87 ms |
| C2 mutual follows in the same city (count) | now | 1 | 4.87 ms | 7.33 ms | 38.32 ms |
Lookups in time views
A point lookup and a two-hop lookup in the current view, as of an earlier transaction and at a valid-time instant. Oxigraph has no time views.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| point | now | 10 | 54 µs | 39 µs | 74 µs |
| point | asOf | 10 | 58 µs | 38 µs | — |
| point | validAt | 10 | 57 µs | 42 µs | — |
| 2-hop | now | 8 | 45 µs | 38 µs | 85 µs |
| 2-hop | asOf | 8 | 58 µs | 37 µs | — |
| 2-hop | validAt | 8 | 57 µs | 37 µs | — |
Cypher
The same graph through openCypher. Oxigraph has no Cypher.
| Query | Variant | Rows | SQLite | redb |
|---|---|---|---|---|
| 2-hop | now | 8 | 1.94 ms | 323 µs |
| star | now | 68 | 13.80 ms | 8.68 ms |
| aggregate | now | 20 | 23.82 ms | 27.36 ms |
Paths
SPARQL reachability, and Cypher shortest path and trail.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| reachability | now | 1 | 2.74 ms | 2.51 ms | 5.63 ms |
| shortest | now | 1 | 146.97 ms | 364.77 ms | — |
| trail 1..3 | now | 1 | 69.93 ms | 183.83 ms | — |
Concurrent readers
Two-hop lookups per second from different users on 1, 4 and 16 threads. Higher is better.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| 2-hop | 1 threads | 17 568/s | 19 668/s | 18 414/s | |
| 2-hop | 4 threads | 16 686/s | 34 883/s | 43 311/s | |
| 2-hop | 16 threads | 16 109/s | 50 397/s | 91 192/s |
Writes
One write per transaction. A tiramemsu write allocates a statement id and a transaction number, checks schemas, records an event, keeps history and cascades; an Oxigraph insert adds a quad.
| Query | Variant | Rows | SQLite | redb | Oxigraph |
|---|---|---|---|---|---|
| insert | watdiv | 111 µs | 120 µs | 5 µs | |
| replace (churn) | watdiv | 119 µs | 167 µs | 17 µs | |
| cascade | watdiv | 409 µs | 461 µs | — | |
| supersede | watdiv | 278 µs | 291 µs | — |
Cyclic patterns
Subgraph counts on a uniform random graph and on a hub-and-spoke graph, where binary joins build large intermediate results. LFTJ is tiramemsu's worst-case-optimal operator for SQLite.
| Query | Variant | Rows | SQLite | SQLite + LFTJ | redb | Oxigraph |
|---|---|---|---|---|---|---|
| triangle | uniform | 1 | 65.61 ms | 45.00 ms | 31.63 ms | 683.14 ms |
| diamond | uniform | 1 | 368.48 ms | 185.54 ms | 96.19 ms | 3.36 s |
| 4-cycle | uniform | 1 | 366.68 ms | 99.63 ms | 76.95 ms | 3.65 s |
| tailed triangle | uniform | 1 | 74.58 ms | 57.71 ms | 45.73 ms | 695.19 ms |
| triangle | skewed | 1 | 265.82 ms | 7.04 ms | 4.67 ms | 3.44 s |
| diamond | skewed | 1 | 5.77 s | 7.13 s | 3.13 s | 48.89 s |
| 4-cycle | skewed | 1 | 4.30 s | 5.83 s | 1.41 s | 50.31 s |
| tailed triangle | skewed | 1 | 289.21 ms | 8.66 ms | 6.17 ms | 3.47 s |
Reproduce it, and read more
cd bench/backends && cargo run --release -- run --scale 1000000 --reps 5 --out results-1000000.json(Oxigraph builds RocksDB;tm benchruns the SQLite and redb part without it). The raw results are results-1000000.json and results-100000.json; the full report with p95 and derived ratios is bench/backends/README.md.- Two engines, one memory: which engine to choose, and why we accept the losses.
- Worst-case-optimal joins on a key-value store: how the native runner joins.
- Why the new engine was not faster, and what made it faster: the profiling behind these numbers.