How we achieved sub-millisecond latencies by rewriting our core matching engine from C++ to Rust.
In high-frequency trading (HFT), every microsecond counts. Traditionally dominated by C++, the HFT space is beginning to see a shift towards Rust. Rust offers the same bare-metal performance and predictable latency as C++ without the memory safety pitfalls that lead to catastrophic segfaults. We detail our journey of rewriting our central order matching engine in Rust. We discuss lock-free data structures, bypassing the OS kernel with custom network drivers, and profiling CPU cache misses, ultimately demonstrating how we achieved a 14% reduction in tail latency.