Tiramemsu

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.

Cycles

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.

Joins

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.

Readers

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.

Writes

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 (SQLite synchronous = NORMAL with 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.

QueryVariantRowsSQLiteredbOxigraph
bulk loadwatdiv89.07 s51.09 s2.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.

QueryVariantRowsSQLiteredbOxigraph
after loadwatdiv287 B2 147 B78 B
after churnwatdiv288 B2 147 B130 B
after compactionwatdiv—1 051 B130 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.

QueryVariantRowsSQLiteredbOxigraph
L1 users in the cities of one countrynow73204.01 ms4.77 ms28.57 ms
L2 reviews of products sold in one citynow063 µs41 µs72 µs
L3 what one user's followees like, with genrenow969 µs58 µs162 µs
S1 products of one genre under a price, with sellernow16545.67 ms7.63 ms37.04 ms
S2 users of one city with age and namenow11382.69 ms2.70 ms12.62 ms
S3 5-star reviews of one genre's products, with reviewernow5982.23 ms3.84 ms195.98 ms
F1 snowflake: users in one city → likes → genre, seller → locationnow1058123.17 ms20.22 ms179.34 ms
F2 good reviews of expensive products in one genre, reviewer's agenow193514.48 ms14.29 ms74.26 ms
C1 reviews per genre (aggregate)now1913.41 ms20.72 ms400.65 ms
C2 mutual follows in the same city (count)now187.07 ms96.17 ms602.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.

QueryVariantRowsSQLiteredbOxigraph
pointnow1059 µs47 µs115 µs
pointasOf1070 µs43 µs—
pointvalidAt1069 µs52 µs—
2-hopnow952 µs48 µs140 µs
2-hopasOf973 µs46 µs—
2-hopvalidAt968 µs45 µs—

Cypher

The same graph through openCypher. Oxigraph has no Cypher.

QueryVariantRowsSQLiteredb
2-hopnow914.44 ms379 µs
starnow827152.47 ms95.12 ms
aggregatenow19389.70 ms372.44 ms

Paths

SPARQL reachability, and Cypher shortest path and trail.

QueryVariantRowsSQLiteredbOxigraph
reachabilitynow134.15 ms33.33 ms107.21 ms
shortestnow11.61 s3.87 s—
trail 1..3now1760.08 ms1.92 s—

Concurrent readers

Two-hop lookups per second from different users on 1, 4 and 16 threads. Higher is better.

QueryVariantRowsSQLiteredbOxigraph
2-hop1 threads14 724/s18 680/s11 700/s
2-hop4 threads13 934/s36 746/s34 344/s
2-hop16 threads15 897/s49 496/s67 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.

QueryVariantRowsSQLiteredbOxigraph
insertwatdiv141 µs146 µs6 µs
replace (churn)watdiv187 µs203 µs16 µs
cascadewatdiv384 µs538 µs—
supersedewatdiv253 µs345 µ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.

QueryVariantRowsSQLiteSQLite + LFTJredbOxigraph
triangleuniform1923.85 ms550.99 ms492.07 ms7.58 s
diamonduniform13.58 s2.24 s1.24 s36.98 s
4-cycleuniform13.57 s1.30 s1.14 s38.81 s
tailed triangleuniform1882.28 ms682.66 ms556.29 ms7.17 s
triangleskewed14.87 s29.00 ms20.76 ms55.35 s
diamondskewed1timeouttimeout69.26 stimeout
4-cycleskewed1timeouttimeout37.62 stimeout
tailed triangleskewed15.52 s35.90 ms27.97 ms55.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.

QueryVariantRowsSQLiteredbOxigraph
bulk loadwatdiv7.10 s2.85 s0.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.

QueryVariantRowsSQLiteredbOxigraph
after loadwatdiv384 B1 343 B79 B
after churnwatdiv388 B1 343 B82 B
after compactionwatdiv—1 056 B135 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.

QueryVariantRowsSQLiteredbOxigraph
L1 users in the cities of one countrynow634402 µs403 µs1.63 ms
L2 reviews of products sold in one citynow121166 µs148 µs481 µs
L3 what one user's followees like, with genrenow979 µs65 µs140 µs
S1 products of one genre under a price, with sellernow136503 µs769 µs2.19 ms
S2 users of one city with age and namenow310490 µs687 µs2.19 ms
S3 5-star reviews of one genre's products, with reviewernow51225 µs372 µs11.34 ms
F1 snowflake: users in one city → likes → genre, seller → locationnow387413.90 ms6.72 ms42.15 ms
F2 good reviews of expensive products in one genre, reviewer's agenow2081.10 ms1.50 ms4.86 ms
C1 reviews per genre (aggregate)now201.16 ms2.04 ms28.87 ms
C2 mutual follows in the same city (count)now14.87 ms7.33 ms38.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.

QueryVariantRowsSQLiteredbOxigraph
pointnow1054 µs39 µs74 µs
pointasOf1058 µs38 µs—
pointvalidAt1057 µs42 µs—
2-hopnow845 µs38 µs85 µs
2-hopasOf858 µs37 µs—
2-hopvalidAt857 µs37 µs—

Cypher

The same graph through openCypher. Oxigraph has no Cypher.

QueryVariantRowsSQLiteredb
2-hopnow81.94 ms323 µs
starnow6813.80 ms8.68 ms
aggregatenow2023.82 ms27.36 ms

Paths

SPARQL reachability, and Cypher shortest path and trail.

QueryVariantRowsSQLiteredbOxigraph
reachabilitynow12.74 ms2.51 ms5.63 ms
shortestnow1146.97 ms364.77 ms—
trail 1..3now169.93 ms183.83 ms—

Concurrent readers

Two-hop lookups per second from different users on 1, 4 and 16 threads. Higher is better.

QueryVariantRowsSQLiteredbOxigraph
2-hop1 threads17 568/s19 668/s18 414/s
2-hop4 threads16 686/s34 883/s43 311/s
2-hop16 threads16 109/s50 397/s91 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.

QueryVariantRowsSQLiteredbOxigraph
insertwatdiv111 µs120 µs5 µs
replace (churn)watdiv119 µs167 µs17 µs
cascadewatdiv409 µs461 µs—
supersedewatdiv278 µs291 µ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.

QueryVariantRowsSQLiteSQLite + LFTJredbOxigraph
triangleuniform165.61 ms45.00 ms31.63 ms683.14 ms
diamonduniform1368.48 ms185.54 ms96.19 ms3.36 s
4-cycleuniform1366.68 ms99.63 ms76.95 ms3.65 s
tailed triangleuniform174.58 ms57.71 ms45.73 ms695.19 ms
triangleskewed1265.82 ms7.04 ms4.67 ms3.44 s
diamondskewed15.77 s7.13 s3.13 s48.89 s
4-cycleskewed14.30 s5.83 s1.41 s50.31 s
tailed triangleskewed1289.21 ms8.66 ms6.17 ms3.47 s

Reproduce it, and read more