Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reference baselines — C FalkorDB 4.x and Rust FalkorDB 6.x

Numbers to chase. Recorded at M0; re-measure at every milestone that claims a win. The bar is the C engine: a capstone number counts as a win only if its median, p99 and memory match or beat C FalkorDB on the same harness and machine. Rust FalkorDB 6.x (the engine developed as falkordb-rs-next-gen, shipped as FalkorDB 6 from FalkorDB/FalkorDB main) is the design reference the capstone rebuilds.

Provenance (Fair Benchmarking §3.1 — reproducibility)

Both engines were built from clean, tagged commits in throwaway git worktrees of ~/repos/FalkorDB, and each identified itself by version at load (MODULE LIST).

C FalkorDBRust FalkorDB 6.x
Tagv4.22.2 (branch 4.22)v6.0.3 (branch 6.0)
Commit7b61f511d (2026-10-19)c937aa4fa (2026-10-22)
MODULE LIST ver4220260003
Build./build.sh → bin/macos-arm64v8-release/falkordb.so (CMake RelWithDebInfo, Homebrew LLVM clang + libomp)cargo build --release → target/release/libfalkordb.dylib (lto = true, codegen-units = 1; GraphBLAS/LAGraph/RediSearch from the native-deps cache, keyed on the submodule revisions)
  • Tracked sources were clean in both worktrees after the build. The one exception is C’s deps/libcsv, whose autotools files the build itself regenerates.
  • The C pin the guides cite, ccb449a9a (2026-07-15), is older than v4.22.2 and was not measured. v4.22.2 was chosen because it is the C engine that currently ships.
  • The prebuilt ~/repos/FalkorDB/bin/macos-arm64v8-release/falkordb.so (2026-07-24) was not used: it reports ver 999999, a dev build that cannot be traced to a commit.
  • Machine: Apple M3 Pro, 36 GB, macOS 26.6.2, redis-server 8.6.2 (jemalloc 5.3.0).
  • Client: Python 3.11.11, FalkorDB==1.8.1, redis==8.1.0, pytest==9.1.1, pytest-benchmark==5.3.0.
  • Run: 2026-10-26. The engines ran one after the other, never concurrently. Load average was 2.9–3.4 on 11 cores during both runs (baselines/load.log): quiet, but not perfectly idle.

Harness: baselines/test_bench.py runs the workload of the reference’s old tests/test_bench.py (removed from FalkorDB at 3e7690dc1; read it with git show 3e7690dc1^:tests/test_bench.py). It keeps the same queries, the same graph and the same fresh-graph-per-round setup. Two things changed. It starts its own redis-server from $FALKORDB_MODULE, so one file drives both engines. And it collects more samples: pedantic benches run 100 rounds (was 5) and the others --benchmark-min-rounds=100. Memory comes from baselines/mem.py. Reproduce everything with baselines/run.sh, which ends by calling baselines/summarize.py. The raw per-round timings are in baselines/bench-*.json (stats.data), and the memory rows are in baselines/mem-*.json.

Methodology caveats (topic 0 lens — read before comparing)

  • Closed loop (pytest-benchmark): these are service times through a Python client, not latency under load. There is no target rate, so coordinated omission does not arise. That is fine for comparing engine throughput, but these numbers cannot back a claim about tails under load.
  • p99 is nearest-rank over N raw samples. It is the ⌈0.99·N⌉-th smallest sample. With N = 100 that is the second-largest sample, so one stall moves it. Treat a p99 gap under ~10% as noise. N is listed per row. Every sample is a single query (iterations == 1, which summarize.py asserts).
  • test_return is the client + RESP + dispatch floor (86–109 µs median here), and every other number includes it. For small queries, engine-side cost ≈ measured − floor.
  • match_* results stream every row back through the Python client. At 100K rows, parsing on the client dominates, which is why C and Rust land within 3% of each other there. Compare capstone numbers using the same client, or not at all (apples vs oranges, §3.3).
  • create/delete benches use benchmark.pedantic: a fresh graph each round, 1 warmup round, and setup time excluded.

Results (per full query; N = samples)

Median and p99, with the ratio Rust ÷ C on the median (< 1 means Rust is faster).

BenchmarknN (C / Rust)C medianC p99Rust medianRust p99Rust÷C
RETURN 1—284 / 156109 µs251 µs86 µs188 µs0.79
unwind range1,000308 / 3282.92 ms9.89 ms2.71 ms6.89 ms0.93
unwind range100,000100 / 100296 ms314 ms287 ms301 ms0.97
create_node1,000100 / 100318 µs383 µs375 µs466 µs1.18
create_node100,000100 / 10018.4 ms20.6 ms29.5 ms35.6 ms1.60
create_relationship (2 nodes + 1 edge each)1,000100 / 100701 µs875 µs959 µs1.14 ms1.37
create_relationship100,000100 / 10060.3 ms65.1 ms78.3 ms85.3 ms1.30
match_node (return all)1,000102 / 1008.8 ms13.8 ms8.74 ms14.7 ms0.99
match_node100,000100 / 100983 ms1.02 s971 ms1.00 s0.99
match_relationship (return n,r,m)1,000100 / 10022.7 ms28.2 ms21.4 ms26.4 ms0.94
match_relationship100,000100 / 1002.50 s2.61 s2.43 s2.47 s0.97
delete_node1,000100 / 100468 µs592 µs292 µs341 µs0.62
delete_node100,000100 / 10030.7 ms33.3 ms16.2 ms17.4 ms0.53
delete_relationship1,000100 / 1001.42 ms1.54 ms608 µs676 µs0.43
delete_relationship100,000100 / 10088.4 ms118 ms30.2 ms33.2 ms0.34

Rust 6.0.3 does not meet the C bar on bulk creation. Its create_node(100K) median is 1.60× C’s and its create_relationship(100K) median is 1.30×, and its p99 is worse in both. It beats C by 2–3× on deletes. On unwind, match and the floor the two engines are within a few percent, except RETURN 1, where Rust is about 20% faster.

Memory (MiB; fresh server per row)

mem.py starts a fresh redis-server for each row, loads the graph with the bench’s own CREATE query, waits 1 s, then reads INFO memory. It then runs the bench’s MATCH query once (returning all n rows) and shuts down. Peak RSS is the “maximum resident set size” that /usr/bin/time -l reports for the whole server lifetime. In both engines used_memory_peak was already at its final value right after the load, so the peak comes from the CREATE, not from the MATCH.

GraphC used_memory after loadC used_memory_peakC peak RSSRust used_memory after loadRust used_memory_peakRust peak RSS
empty server2.82.819.82.92.922.5
100K nodes9.546.563.17.226.961.3
1M nodes60.1378.7388.144.1297.5304.3
100K × (2 nodes + edge)19.9103.9111.018.561.993.4
1M × (2 nodes + edge)150.4886.1878.5153.9705.9693.0
  • Steady-state size is close between the engines. Rust is smaller on node-only graphs (44.1 vs 60.1 MiB at 1M nodes) and about the same on the edge graph (153.9 vs 150.4 MiB). Both engines allocate through the Redis allocator: Rust’s used_memory agrees with its own GRAPH.MEMORY USAGE total (141 MB at 1M edges), so the two used_memory columns are comparable. The raw JSON also records used_memory_rss and the per-component GRAPH.MEMORY USAGE breakdown.
  • The load peak, not the resting graph, sets peak memory. A single UNWIND … CREATE of 1M edges peaks at 5.9× the resting size in C (886 vs 150 MiB) and at 4.6× in Rust (706 vs 154 MiB). Rust’s peak RSS is lower in every loaded row, by 3–22%. A capstone that matches resting size but buffers the whole CREATE has not met the bar.

What M-milestones should chase

The target for each row is the better of the C and Rust columns, at both median and p99. Memory is held to the same rule.

  • M13 (naive graph core): create_node / create_relationship / delete_* engine-side throughput. Beat C on creation (C is the faster engine there) and Rust on deletion, after subtracting the ~0.1 ms RESP + Python floor. Keep the 1M-edge load peak under C’s 886 MiB used_memory_peak.
  • M7 (RESP server): reproduce test_return’s 86–109 µs floor with falkordb-py against the capstone server, then measure properly (open loop + HdrHistogram).
  • M20 (sparse core): match_* on the traversal side. Use LDBC (M22), not these micro matches, for the headline comparison, because at 100K rows the client parse hides the engine.