CppCon 2017: Chandler Carruth “Going Nowhere Faster”
Channel:CppCon · Length:1:00:57 · Published:2017-11-02 · Views:113359
Summary
Chandler Carruth shows how to squeeze more performance out of already-optimized C++ code, covering how the CPU executes it. The talk goes into pipelining, branch prediction and speculative execution using benchmarks.
Why HN recommends it
Recommended as the best presentation on how modern CPUs run code, and why speculative execution matters for performance.
The best presentation I've seen about CPU performance related to pipelining, branch prediction, and speculative execution — HN, 2026
C, C++, Rust, Go & systems languages · Software performance & optimization · Computer architecture & CPUs
Subtitles (excerpt)
All right, folks, come on in. I wanna give you all a fair warning. You probably want to move towards the front of the room. I know it's scary up here. I'm not gonna throw anything. But there's gonna be a lot of code. It's gonna be kind of small. Because I'm gonna actually be coding it live, and so I can't use super big slide fonts, sorry. But yeah, people way in the back, you're gonna have a hard time. You might wanna move up a little bit. We have enough space here. All right, so my name's Chandler Carruth. I'm here to talk to you about going absolutely nowhere faster, which is probably a little bit of a confusing title. Sorry for that. But it seemed like a good funny joke. This talk is gonna be a little bit unusual. So a lot of my optimization talks, I actually try and tell you how to make things go faster. I've given several optimization talks at CppCon. This one's not going to do that. If that's why you're here, sorry. I'm trying to set expectations, so. I am gonna try and tell you how to understand why your code is going fast or isn't going fast. But today we're gonna focus on when your code is actually going nowhere at all, but either fast or not fast. We're gonna talk about loops.
On Hacker News
The best presentation I've seen about CPU performance related to pipelining, branch prediction, and speculative execution was Chandler Carruth's "Going Nowhere Faster" presentation at CppCon 2017 [0]. I do recommend watching the whole presentation, but if you watch nothing else then just watch the 5 minutes or so from the linked timestamp. [0]: [VIDEO] — inetknght, 2026-04
Chandler Carruth has a good talk with an example of why speculative execution is critical for performance. [VIDEO] It starts around 36m13s time frame. — pkaye, 2018-11
Disclaimer: I am not an expert and have not measured. This is armchair theory. But, I would argue two things. First, the former appears to have at least one unaligned arithmetic: > 400538: mov 0x200b01(%rip),%rdx # 601040 <counter> ...while the latter's equivalent instruction is 4-byte aligned: > 40057d: mov 0x200abc(%rip),%rdx # 601040 <counter> So, I would argue that's the biggest source of _sp… — inetknght, 2017-12
Sure, but wouldn’t it make sense to extend the instruction set to allow the compiler to use these registers instead of reserving them for speculative / out-of-order execution? It was just a thought i had after watching a talk by a compiler guy: [VIDEO] — mathiasgredal, 2023-12
>The YouTube inteface says "auto-generated" Ok, I never noticed that. I just read the captions and assumed obvious misspellings were auto-generated. For example in this video[1], the caption text is "L1D cache misses" but he's actually saying "L1-dcache misses" . (The Linux terminal screen he's showing does display "L1-dcache" .) Even though that video is not labeled as "auto-generated", I assume… — jasode, 2018-06
Related videos
- Inside Africa's Food Forest Mega-Project · Andrew Millison · 14:10
- De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable - Herb Sutter CppCon 2019 · CppCon · 1:33:12
- CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?” · CppCon · 1:14:22
- Amazon Sells Fake Electrical Fuses · Louis Rossmann · 31:04
- Jared Mauch - Getting Fiber To My Town (NLNOG Live! September 2020) · NLNOG · 34:42
- The essence of calculus · 3Blue1Brown · 17:04
- CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17” · CppCon · 1:19:52
- C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024 · CppCon · 1:24:36
- CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid” · CppCon · 1:15:45
- India's Semiconductor Failure · Asianometry · 17:13
- Copper vs Pex vs SharkBite - Freeze Testing · Matt Risinger · 13:00
- U.S. NAVY BASIC MECHANISMS OF FIRE CONTROL COMPUTERS MECHANICAL COMPUTER INSTRUCTIONAL FILM 27794 · PeriscopeFilm · 19:42
- The Extreme Engineering of ASML’s EUV Light Source · Asianometry · 17:20
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework · Видео с мероприятий {speach! · 49:55
- 8-bit computer update · Ben Eater · 6:53
- CppCon 2015: Andrei Alexandrescu “std::allocator...” · CppCon · 1:12:27