CppCon 2017: Carl Cook “When a Microsecond Is an Eternity: High Performance Trading Systems in C++”
Channel:CppCon · Length:1:00:07 · Published:2017-10-08 · Views:360406
Summary
Optiver's Carl Cook explains how to build high-frequency trading systems in C++, where the critical path runs rarely but must be extremely fast. He covers techniques for low and predictable latency, including avoiding main memory and cache misses.
Why HN recommends it
HN repeatedly points people to it as the best overview of low-latency trading engineering.
Here are some talks that will give you a small overview into that world — HN, 2020
C, C++, Rust, Go & systems languages · Software performance & optimization
Subtitles (excerpt)
- Cool so yeah, good afternoon everyone. My name is Carl, I work for a company called Optiver. I work writing automated trading systems and I've done that for about 10 years in total. So today's talk is just going to be basically a day in the life of a developer of high frequency trading systems. I'm also a member of SG14, so I try to give a little bit of feedback from the trading community into their standards. What's important from the low latency perspective from trading. But I'm definitely not a C++ expert. There's people in this room who will know 10 times more about C++ than me. It's not necessarily a problem though. You just need to be really good at measurement. You need to be really good at applying scientific method. You need to understand the tools. If you can do that and you can measure and you can measure well, you can write very very fast software without knowing the standard inside out. So I'm gonna give a very quick overview of what we do. Won't go into that in much detail, 'cuz that can take an hour or two just by itself. But I will talk about the technical challenges that we face. Those two topics are just an introductory, then we get into the real stuff, which is the actual techniques that I use on a daily basis for writing fast C++.
On Hacker News
Doesn't the fact that a modern FPGA-centric (probably ASICs in the mix too at this point) hybrid NIC/order-parser/state-machine thing is rumored to be able to hit glass-to-glass of ~20-40ns mean that the speed game is hotter than ever? Do you mean that because it involves a lot of hardware design now? The days of being able to offer around the inside in C++ on a regulated securities exchange are … — benreesman, 2025-08
This is almost certainly incorrect, unless it’s using a very stretched definition of “hft” and using microseconds to mean 99th% <1ms instead of say <5us (reasonably competitive software range depending on your trade). They might be forwarding non latency sensitive client/internal orders through a system written in erlang, or using erlang for an orchestration layer, but they’re not competing with … — vgatherps, 2023-09
I find this stuff fascinating, and this article is way above average for online posts about proprietary/algorithmic/quantitative/low-latency trading (very leaky Venn diagram there). I have a few nitpicks but overall it's informative and it's an interesting format: viewing an industry through the lens of a particular firm, especially one as fascinating as Jane. Anything that develops literacy in m… — benreesman, 2022-08
First of all, it leaves the team behind if you use features that are too advanced. Makes collaboration hard if you have wildly diverging skills (in both ways). Also, it did in our case take you away so far from the bare metal, that the code was elegant, but slow. It did not play well with our static allocators and allocated/deallocated way too much, especially temporaries. You might i.e. check ou… — jeffreygoesto, 2020-11
I’ve seen this sentiment before and worked on both a “low latency Java” team and low latency C++ teams. I have some sympathy for the idea that the JVM is better since it means you won’t spend all your time chasing crash reports. The thing is, like another comment hinted at, is that this issue is generally more reflective of the environment you build in than the technology choice. Here’s a good ta… — vgatherps, 2020-11
Related videos
- Ses 1: Introduction and Course Overview · MIT OpenCourseWare · 1:07:12
- GPT-4chan: This is the worst AI ever · Yannic Kilcher · 19:19
- Advanced Topics in Programming Languages: A Lock-Free Hash Table · GoogleTalksArchive · 58:35
- The Man behind Stable Diffusion · Yannic Kilcher · 25:42
- "Simple Made Easy" - Rich Hickey (2011) · Strange Loop Conference · 1:01:38
- Joe Armstrong - Keynote: The Forgotten Ideas in Computer Science - Code BEAM SF 2018 · Code Sync · 49:35
- CppCon 2014: Herb Sutter "Back to the Basics! Essentials of Modern C++ Style" · CppCon · 1:40:26
- CppCon 2015: Kate Gregory “Stop Teaching C" · CppCon · 1:00:11
- Edwin Brady - Idris 2 - Type-driven Development of Idris · Curry On! · 40:38
- Eric Bier Demonstrates Cedar · Computer History Museum · 1:56:07
- CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.” · CppCon · 1:39:25
- CppCon 2016: Dan Saks “extern c: Talking to C Programmers about C++” · CppCon · 1:36:26
- "A Political History of X" - Keith Packard (LCA 2020) · linux.conf.au · 45:33
- RailsConf 09: Robert Martin, "What Killed Smalltalk Could K · O'Reilly · 1:00:55
- CppCon 2017: Kate Gregory “10 Core Guidelines You Need to Start Using Now” · CppCon · 1:02:33
- CppCon 2015: Herb Sutter "Writing Good C++14... By Default" · CppCon · 1:29:05
- Yesterday's Computer of Tomorrow: The Xerox Alto │Smalltalk-76 Demo · Computer History Museum · 16:48
- SYMBOLICS S-PACKAGES 3D GRAPHICS AND ANIMATION DEMO · Red Martian · 29:16
- Alto System Project: Dan Ingalls demonstrates Smalltalk · Computer History Museum · 2:08:02
- Alan Kay's tribute to Ted Nelson at "Intertwingled" Festival · TheTedNelson · 17:33