Benchmarks
Cross-language
Bindings performance comparison
Rust and Python run the same graph benchmark, so their numbers compare directly. The TypeScript benchmark measures the fluent API against the low-level API on a smaller graph.
Rust and Python
p50 latency from the single-file raw benchmark on the same 10k nodes, 50k edges graph, MVCC on.
| Operation | Rust p50 | Python p50 |
|---|---|---|
| Key lookup (random existing key) | 42 ns | 125 ns |
| 1-hop traversal (out, random node) | 42 ns | 250 ns |
| Edge exists (random pair) | 42 ns | 125 ns |
| Batch write (100 nodes) | 17.92 µs | 24.71 µs |
| Batch write (100 edges) | 16.08 µs | 18.25 µs |
| Batch write (100 edges + props) | 65.50 µs | 201.83 µs |
| Get vector (random) | 83 ns | 708 ns |
| Has vector (random) | 42 ns | 125 ns |
| Set vectors (batch of 100) | 67.96 µs | 105.46 µs |
Source: 2026-10-03-r2-single-file-raw-rust-mvcc-normal.txt, 2026-10-03-r2-single-file-raw-python-mvcc-normal.txt (10k nodes, 50k edges, 3 edge types, 10 edge props, 1k vectors of 128 dims, sync=normal, MVCC on)
TypeScript: fluent vs low-level API
What the fluent API (db.get, db.from().out()) costs over the low-level calls it wraps, measured in Node. This run uses a smaller graph (1k nodes, 5k edges), so compare its rows with each other, not with the Rust and Python table.
| Operation | Low-level p50 | Fluent p50 | Overhead |
|---|---|---|---|
| Insert (single node + props) | 5.50 µs | 6.79 µs | 1.23x |
| Key lookup (get, with props) | 167 ns | 1.33 µs | 7.98x |
| Key lookup (getRef, no props) | 166 ns | 584 ns | 3.52x |
| Key lookup (getId, id only) | 166 ns | 292 ns | 1.76x |
| 1-hop traversal (count) | 709 ns | 1.13 µs | 1.59x |
| 1-hop traversal (node ids) | 750 ns | 1.33 µs | 1.78x |
| 1-hop traversal (toArray, with props) | 750 ns | 3.42 µs | 4.56x |
| Pathfinding BFS (max depth 5) | 3.46 µs | 2.88 µs | 0.83x |
Source: 2026-10-03-r2-bench-fluent-vs-lowlevel-mvcc-normal.txt (1k nodes, 5k edges, 3 edge types, 10 edge props, 1k iterations, sync=normal, MVCC on, Node 24.21.0)
Vector index numbers are on the vector benchmarks page.
Running benchmarks
Commands from docs/BENCHMARKS.md, run from the repository root. Rust core:
cd ray-rscargo run --release --example single_file_raw_bench --no-default-features -- \ --nodes 10000 --edges 50000 --iterations 10000 \ --wal-size 268435456 --no-auto-checkpoint --seed 42 --sync-mode normal --mvccPython bindings:
cd ray-rs/python/benchmarkspython3 benchmark_single_file_raw.py \ --nodes 10000 --edges 50000 --iterations 10000 \ --wal-size 268435456 --no-auto-checkpoint --seed 42 --sync-mode normal --mvccTypeScript, fluent vs low-level API:
cd ray-rsnode --import @oxc-node/core/register benchmark/bench-fluent-vs-lowlevel.ts --mvcc --seed 42