CppCon 2017: Chandler Carruth “Going Nowhere Faster”

Channel:CppCon · Length:1:00:57 · Published:2017-11-02 · Views:113359

Watch on YouTube

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