// 04 · Engine latency

How fast is the Rust engine?

In-process monotonic-clock measurements. No network. No HTTP. Pure engine cycles. Measured 2026-04-24, engine 0.4.48, {{n}} samples.

Engine only, not end-to-end wall time

These numbers measure the Rust engine hot path, parse, state-cache writes, full pipeline, all in-process, all monotonic clock. They do NOT include network round-trip, venue WS latency, or broker fill time. Per-venue network lag is measured separately as recv_wall_ns − state_cache_updated_ns (recv minus state-updated). Read the Latency Matrix doc for the full breakdown.

p50
310 ns
p95
980 ns
p99
1,950 ns

Histogram over MarketState::update_ticker_owned samples of 89,033 (engine 0.4.48), nanoseconds, in-process monotonic clock

Full Rust engine pipeline

All seven metrics from the Latency Matrix (engine 0.4.48). State writes at nanosecond scale; parse + end-to-end at microsecond scale. All in-process. None of this is network.

metricnp50p99note
state_ticker_ns89,033310 ns1.95 µsSingle ticker state-cache write. The smallest unit of engine work, one symbol's price, volume, and timestamp committed to the market state. This is the 310 ns headline.
state_mark_price_ns1202.15 µs3.73 µsMark price state write. Slightly heavier than a ticker write, mark price carries additional fields (funding rate, index price) into the state.
state_order_update_ns3,4583.69 µs13.86 µsOrder-lifecycle state write: new, partially filled, filled, cancelled. Each status transition touches the order map and the per-symbol order index.
state_ob_snap_ns16,4064.44 µs17.42 µsFull orderbook snapshot write. Replaces the entire bid/ask ladder for a symbol in one atomic operation. Heavier than a delta because it rewrites the full depth.
state_ob_delta_ns102,5495.51 µs16.34 µsIncremental orderbook delta. Applies one side's price-level update to the live ladder. Cheaper than a snapshot; most ticks are deltas.
parse_ns176,5551.76 µs77.95 µsFull WS frame parse: JSON or binary decode, message type routing, symbol lookup. The engine parses every frame before the state write. This is the parse-only cost.
end_to_end_ns176,55514.40 µs248.96 µsEnd-to-end pipeline: parse + state write, the full in-process hot path from raw frame to updated market state. The 14.4 µs headline is this number.

Hardware-tier expectations

The 310 ns headline is measured on a pinned Intel Xeon 8369B (tier A). Sub-microsecond p50 is the defining property of engine-tier hardware. Throttled laptops or shared VMs may drift past 1 µs, that reflects the hardware, not the engine.

tierhardwareconfigp50p95
AIntel Xeon 8369B (Ice Lake-SP)Linux 5.15, pinned core, performance governor, Rust 1.78310 ns980 ns
BAMD EPYC 7763 / Xeon Gold 6338Linux 5.15+, performance governor, Rust 1.78350–500 ns0.7–1.2 µs
CApple M2 / M3 MacBookmacOS 14+, arm64, Rust 1.78250–450 ns0.6–1.1 µs
DIntel i7-12700H / Ryzen 9 7945HX laptopLinux/Win11, unpinned, Rust 1.78400–650 ns0.8–1.4 µs

Reproduce this in three commands

The bench is a self-contained Rust crate. No platform clone required, no external services.

# 1. Clone the public OSS repo
git clone https://github.com/melaya-labs/melaya.git
cd melaya/benchmarks/engine

# 2. Run the criterion bench (~100k iterations, ~30 seconds)
cargo bench --bench state_ticker

# 3. Read the per-iteration CSV + summary
cat results/state_ticker_ns.csv | head
cat results/summary.json

Total wall time: under 30 seconds on tier-A hardware. The criterion harness writes results/state_ticker_ns.csv + results/summary.json. Full methodology in the bench README.

Join the community
// Cookies
Melaya uses a small set of first-party cookies that are strictly necessary to authenticate you, maintain your session, and protect the platform from abuse. We do not use advertising cookies, cross-site trackers, or third-party analytics by default. The full cookie list is in our Privacy Policy.