Why
Small allocations, synchronization, and backpressure can dominate latency-sensitive producer-consumer systems.
Tech stack
- C++20
- CMake
- CTest
- SPSC/MPSC queues
- Sanitizers
Key metrics
4.2M messages per second
<35 μs p99 latency
What I built
- Implemented preallocated event storage and SPSC/MPSC producer-consumer paths.
- Built seeded workload generation, deterministic replay, and invariant checks.
- Separated warmup, throughput, and percentile-latency reporting.
How it works
- Seeded events
- SPSC or MPSC producers
- Ring buffer
- Stateful consumer
- Replay checks
- Latency report
Evaluation
- Replay identical seeded workloads across ring-buffer and mutex-backed queue variants.
- Report throughput and latency percentiles after warmup; run CTest and supported sanitizers.
| Measure | Result | Boundary |
|---|---|---|
| Throughput | 4.2M messages/second | Single-machine local run |
| Tail latency | p99 below 35 microseconds | Not a network or exchange guarantee |
| Correctness | Replay, invariants, and sanitizer runs | Public test source pending |
Limitations
- The measurements are local single-machine results.
- The public source and benchmark artifact are not yet available.
- The price-time-priority order book remains a design boundary, not a published implementation.
Links and reproducibility
- Publish compiler and host metadata, queue capacity, producer count, payload shape, seed, and raw percentiles.
- Require clean Release and sanitizer builds before treating the benchmark as reproducible.
Public source is not available yet.