Striving for ultimate Low Latency
summary
Low-latency trading systems target 1–10 microseconds software paths and claim hardware setups can be an order of magnitude faster; Knight Capital’s 2012 bug losses (~$440M in 45 minutes) shows costly edge cases. Practical rules: avoid shared_ptr and std::function, RTTI, polymorphism, dynamic allocations on the fast path; prefer unique_ptr, SSO or in-place buffers, custom allocators/PMR, templates for static polymorphism. Architectures use spin-wait, pin threads to cores, separate I/O thread, lock-free queues, and measure with perf/VTune and flame graphs.
AI-written summary · about
chapters (23)
- 0:00Introduction and background
- 1:14Defining latency and throughput
- 3:01Importance of low latency
- 5:46High-frequency trading environment
- 8:18Latency in trading orders
- 10:44Consequences of software bugs
- 11:49Hardware and OS optimizations
- 12:12Spin, pin, and drop-in concepts
- 14:36Focus on C++ and software
- 16:01Predictable performance requirements
- 18:28Avoiding unnecessary code
- 19:57Problems with shared pointers
- 23:51Smart pointer alternatives
- 26:20C++ exceptions performance
- 31:31Exception safety in code
- 33:52Avoiding polymorphism
- 37:31Runtime type identification issues
- 38:58Memory allocation pitfalls
- 41:53Custom allocators and SSO
- 44:00System design for low latency
- 45:26Performance measurement best practices
- 47:15Profiling and assembly reading
- 49:07Summary and Q&A
