Optimizations in the HFT world
summary
Dedicated servers run isolated with isoCPU and real-time threads avoid syscalls by using static memory pools; networking uses Solarflare cards with onload, tcp direct or low-level efvi to shave thousands of ns. Cache-warming sends dummy orders every N events to keep rare risk-check paths hot; an example trades 2→3µs for common events but cuts the critical execution path 5→4µs, winning the market. A custom single-consumer multi-producer queue with per-producer subqueues raises retiring from ~4% to ~14% and the pop retiring to ~73%; code is published for testing.
AI-written summary · about
chapters (16)
- 0:00Introduction and background
- 4:02High-level HFT architecture
- 6:07Thread isolation and CPU scheduling
- 9:21Bypassing the kernel for performance
- 12:33Latency vs throughput in HFT
- 13:58Optimizing for rare events
- 16:08Cache warming techniques
- 19:44Risk checks and exceptions
- 23:14Data sharing between threads
- 32:29Optimizing for throughput
- 34:12Market open/close challenges
- 35:19Queue performance analysis
- 37:48Single-consumer multi-producer queue
- 47:04Further queue optimizations
- 51:16Benchmarking and measurement
- 53:04Hiring and closing remarks
