Skip to Content
raikiri

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

MachineApple MacBook Pro, M4 Pro, 14 cores, 24 GB
OSmacOS 15.7
CompilerApple clang 17, CMake preset bench (Release)
Date2026-11-29, raikiri 0.1.0-beta.1
Loada 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.

PercentileRound tripOne way
p50167 ns83 ns
p90209 ns104 ns
p99250 ns125 ns
p99.9333 ns166 ns
max13.7 µs6.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.

OperationTimeRate
seqlock read (latest quote)0.71 ns1.42 G/s
SPSC push + pop1.70 ns589 M/s
seqlock write1.71 ns584 M/s
broadcast publish2.14 ns467 M/s

Order book

Applying a venue's depth update and pruning the levels outside the band a strategy reads.

Operation50 levels500 levels1,000 levels
drop levels beyond the band5.5 ns10.5 ns12.5 ns
apply a delta, then prune31.6 ns49.9 ns56.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 core

bench/ 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.

Edit this page on GitHub

On this page