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.
Histogram over MarketState::update_ticker_owned samples of 89,033 (engine 0.4.48), nanoseconds, in-process monotonic clock
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.
| metric | n | p50 | p99 | note |
|---|---|---|---|---|
state_ticker_ns | 89,033 | 310 ns | 1.95 µs | Single 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_ns | 120 | 2.15 µs | 3.73 µs | Mark price state write. Slightly heavier than a ticker write, mark price carries additional fields (funding rate, index price) into the state. |
state_order_update_ns | 3,458 | 3.69 µs | 13.86 µs | Order-lifecycle state write: new, partially filled, filled, cancelled. Each status transition touches the order map and the per-symbol order index. |
state_ob_snap_ns | 16,406 | 4.44 µs | 17.42 µs | Full 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_ns | 102,549 | 5.51 µs | 16.34 µs | Incremental orderbook delta. Applies one side's price-level update to the live ladder. Cheaper than a snapshot; most ticks are deltas. |
parse_ns | 176,555 | 1.76 µs | 77.95 µs | Full 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_ns | 176,555 | 14.40 µs | 248.96 µs | End-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. |
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.
| tier | hardware | config | p50 | p95 |
|---|---|---|---|---|
| A | Intel Xeon 8369B (Ice Lake-SP) | Linux 5.15, pinned core, performance governor, Rust 1.78 | 310 ns | 980 ns |
| B | AMD EPYC 7763 / Xeon Gold 6338 | Linux 5.15+, performance governor, Rust 1.78 | 350–500 ns | 0.7–1.2 µs |
| C | Apple M2 / M3 MacBook | macOS 14+, arm64, Rust 1.78 | 250–450 ns | 0.6–1.1 µs |
| D | Intel i7-12700H / Ryzen 9 7945HX laptop | Linux/Win11, unpinned, Rust 1.78 | 400–650 ns | 0.8–1.4 µs |
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.