It’s a single-threaded C++ engine that achieves ~320ns insertion latency and 3.2m+ orders/sec throughput.
Technical details:
Memory: Everything is pre-allocated. No new/malloc on the hot path.
Data Structures: I wrote a custom Robin Hood hash map and intrusive lists to keep order management O(1) and cache-friendly.
Architecture: It includes a pre-trade risk check and a backtester.
The code is obviously not production-ready for a real exchange, but I’d love feedback on the C++ implementation and memory layout.
Repo: https://github.com/eelixir/mercury
tjwells•1h ago
It’s a single-threaded C++ engine that achieves ~320ns insertion latency and 3.2m+ orders/sec throughput.
Technical details:
Memory: Everything is pre-allocated. No new/malloc on the hot path.
Data Structures: I wrote a custom Robin Hood hash map and intrusive lists to keep order management O(1) and cache-friendly.
Architecture: It includes a pre-trade risk check and a backtester.
The code is obviously not production-ready for a real exchange, but I’d love feedback on the C++ implementation and memory layout.
Repo: https://github.com/eelixir/mercury