Benchmarks
Measured latency of raikiri's transport and book code, the hardware it ran on, and how to reproduce it.
Results of make bench on the machine below. To measure your own hardware, see Reproduce.
Hardware and build
| Machine | Apple MacBook Pro, M4 Pro, 14 cores, 24 GB |
| OS | macOS 15.7 |
| Compiler | Apple clang 17, CMake preset bench (Release) |
| Date | 2026-11-29, raikiri 0.1.0-beta.1 |
| Load | a normal workday desktop, load average about 9; threads not pinned (macOS cannot pin) |
Production runs on Linux x86-64. Gateways for 40+ venues have run together on one 6 vCPU, 24 GB cloud VM.
Between two processes
Two processes, one SPSC ring each way in shared memory, 200,000 round trips.
| Percentile | Round trip | One way |
|---|---|---|
| p50 | 167 ns | 83 ns |
| p90 | 209 ns | 104 ns |
| p99 | 250 ns | 125 ns |
| p99.9 | 333 ns | 166 ns |
| max | 13.7 µs | 6.9 µs |
The maximum is scheduler preemption. On Linux the benchmark pins both sides with --cpu A --cpu-child B.
Shared-memory primitives
Single operation, one thread, no contention.
| Operation | Time | Rate |
|---|---|---|
| seqlock read (latest quote) | 0.71 ns | 1.42 G/s |
| SPSC push + pop | 1.70 ns | 589 M/s |
| seqlock write | 1.71 ns | 584 M/s |
| broadcast publish | 2.14 ns | 467 M/s |
Order book
Applying a venue's depth update and pruning the levels outside the band a strategy reads.
| Operation | 50 levels | 500 levels | 1,000 levels |
|---|---|---|---|
| drop levels beyond the band | 5.5 ns | 10.5 ns | 12.5 ns |
| apply a delta, then prune | 31.6 ns | 49.9 ns | 56.9 ns |
What these numbers do not include
- Network time from the exchange to your machine, usually milliseconds.
- TLS decryption and JSON parsing of a venue frame, which happen before the shared-memory write.
Reproduce
make bench
cd build/bench/bench
./shm_pingpong # cross-process round trip
./ring_throughput # seqlock and ring primitives
./ladder_prune # order book updates
./shm_pingpong --cpu 2 --cpu-child 3 # Linux: pin each side to a corebench/ also holds trading_path, client_path, order_trail and option_board, which time the risk gate,
the client API and the option chain. Their results are not published yet.