C++20 · Low-latency systems

C++ Event Processing and Matching Engine

A deterministic event engine for measuring queue design, throughput, and tail latency.

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

  1. Seeded events
  2. SPSC or MPSC producers
  3. Ring buffer
  4. Stateful consumer
  5. Replay checks
  6. 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.
Current local benchmark
MeasureResultBoundary
Throughput4.2M messages/secondSingle-machine local run
Tail latencyp99 below 35 microsecondsNot a network or exchange guarantee
CorrectnessReplay, invariants, and sanitizer runsPublic 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.