Skip to content
0:00 / 0:00

#cppcon#chandlercarruth#branchprediction

CppCon 2017: Chandler Carruth “Going Nowhere Faster”

CppCon

189K subscribers • 103 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 2 on Hacker News.
  • A classic. People kept recommending it from 2017 to 2026.
  • Presented by Chandler Carruth, compiler engineer at Google
  • Linked in the descriptionCppCon/CppCon2017

Advanced. Deep dive for people who know the field.

113K views9 years ago2 recommendations

Systems programmingProgramming languagesC++Performance and optimizationCPUs and computer architecture

Chandler Carruth explains how modern CPUs execute loops, focusing on pipelining, branch prediction, and speculative execution to optimize C++ code.

CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2017 — You care about the performance of your C++ code. You have followed basic patterns to make your C++ code efficient. You profiled your application or server and used the appropriate algorithms to minimize how much work is done and the appropriate data structures to make it fast. You even have reliable benchmarks to cover the most critical and important parts of the system for performance. But you're profiling the benchmark and need to squeeze even more performance out of it... What next? This talk dives into the performance and optimization concerns of the important, performance critical loops in your program. How do modern CPUs execute these loops, and what influences their performance? What can you do to make them faster? How can you leverage the C++ compiler to do this while keeping the code maintainable and clean? What optimization techniques do modern compilers make available to you? We'll cover all of this and more, with piles of code, examples, and even live demo. While the talk will focus somewhat on x86 processors and the LLVM compiler, but everything will be broadly applicable and basic mappings for other processors and toolchains will be discussed throughout. However, be prepared for a lot of C++ code and assembly. — Chandler Carruth: Google, Software Engineer Chandler Carruth leads the Clang team at Google, building better diagnostics, tools, and more. Previously, he worked on several pieces of Google’s distributed build system. He makes guest appearances helping to maintain a few core C++ libraries across Google’s codebase, and is active in the LLVM and Clang open source communities. He received his M.S. and B.S. in Computer Science from Wake Forest University, but disavows all knowledge of the contents of his Master’s thesis. He is regularly found drinking Cherry Coke Zero in the daytime and pontificating over a single malt scotch in the evening. — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf --- Videos Filmed & Edited by Bash Films: BashFilms.com

Why it's here

2 people recommend this

What people say. Recommended as an exceptional explanation of CPU pipelining, branch prediction, and speculative execution for performance tuning.

inetknghton Hacker News • Recommends

On “Visualizing CPU Pipelining (2024)”

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: link to this video

inetknghton Hacker News • Recommends

On “Intel i7 loop performance anomaly (2013)”

…there are no data dependencies there and the data's never even stored; I'd argue that it probably never even gets executed because the instruction should fit in instruction cache and branch prediction cache and all. Arguably. Like I said, I'm not an expert. I'd say run it through Intel's code analyzer tool. link Tangential video worth watching: link to this video Edit: actually, thinking about it, it's not unaligned access , it's unaligned math . I don't think that should affect performance at all? Fun.…

pkayeon Hacker News • Recommends

On “Researchers discover seven new Meltdown and Spectre attacks”

Chandler Carruth has a good talk with an example of why speculative execution is critical for performance. link to this video It starts around 36m13s time frame.

u/skeetoin r/C_Programming • Mentions

On “Why is there no C conference?”

Every year you can think of a subset of CppCon as being like a C conference. There are a bunch of presentations that are entirely or mostly relevant to C, and not just in a broader sense of being relevant to *any* language. I plucked out a bunch from CppCon 2017 for you. These are *roughly* ordered from best to worst: * [Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”] * Chandler Carruth “Going Nowhere Faster” * James McNellis “Everything You Ever Wanted to Know about DLLs” * John Regehr “Undefined Behavior in 2017 (part 1 of 2)” * John Regehr “Undefined Behavior in 2017 (part 2 of 2)” * Piotr Padlewski “Undefined Behaviour is awesome!” * [Tob…

jasodeon Hacker News • Mentions

On “DevTube: Searchable index of developer videos”

>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 video1, 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 assumed it was because of the bad caption. Based on your info, I guess CppCon uses humans like Mechanical Turk or other non-domain typists to manually add the captions. 1 link to this video

mathiasgredalon Hacker News • Mentions

On “Ubuntu 24.04 LTS will enable frame pointers by default”

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: link to this video