~/talk

When Nanoseconds Matter: Ultrafast Trading Systems in C++

Talkat CppCon 2024 · on Thursday, 2024-09-19· at 10:30· Adams A, 6700 North Gaylord Rockies Boulevard· [web-performance]
links:none on file
slides:none on file

Claims are concrete: an order book with ~1000 levels per side is fastest as a contiguous array reversed so top‑of‑book updates avoid vector shifts, linear search beats binary on hot short ranges and branchless lower_bound raises IPC from ~1.4 to ~1.6. Tools are real: perf, hardware counters, clang x‑ray, AMD Z4 Zen4 microbenchmarks, Solarflare/onload and efvi/DPDK for networking. Numbers that surprise: kernel UDP ≈3 μs vs ≈700 ns layer‑2 UDP, 73‑byte messages for queue tests. Built pieces: a simple 150‑line shared‑memory bounded queue with reservation trick (reserve 100 KB) that reduces atomic contention and measures well.

AI-written summary · about

  1. 0:00Ultrafast trading systems intro
  2. 1:16Roman Empire lessons on planning
  3. 4:50Market making as losers game
  4. 7:57Software still matters in low latency
  5. 10:45Order book fundamentals and data structures
  6. 15:39Order book with std::map limitations
  7. 17:23Latency distribution of data structures
  8. 20:11Avoid node-based containers
  9. 21:57Replace std::map with std::vector
  10. 25:50Understand domain for half-solved problems
  11. 26:55Leverage problem-specific properties
  12. 27:16Profiling with perf and Top-Down Analysis
  13. 30:07Branch mispredictions in binary search
  14. 31:51Branchless binary search optimizations
  15. 33:37Simplicity as ultimate optimization
  16. 35:44Mechanical sympathy with hardware
  17. 36:47Instruction cache and inlining trade-offs
  18. 39:16Lambda optimizations pitfalls
  19. 40:19Networking and concurrency in low latency
  20. 41:23Bypass kernel for ultra-low latency
  21. 42:25Networking APIs performance comparison
  22. 43:07Mindful use of system components
  23. 44:29Shared memory fundamentals
  24. 45:56Bounded concurrent queues design
  25. 49:11Right concurrency tool choice
  26. 51:21Fast concurrent queue with atomics
  27. 53:06Data races and atomic operations
  28. 54:35Concurrent queue benchmarks
  29. 56:01Atomic counter batching optimization
  30. 1:01:16Intrusive profiling for bottlenecks
  31. 1:04:43Clang X-Ray for production profiling
  32. 1:06:29Stay fast with constant vigilance
  33. 1:07:56System-wide performance awareness
  34. 1:09:20Cache hierarchy impact on workers
  35. 1:13:13No silver bullets in low latency
  36. 1:14:39References and further learning
  37. 1:15:00Q&A on trading system optimizations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.