CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!"

CppCon · 188K views · 2015 · 1:29:54

Open on YouTube

Software performance & optimizationC, C++, Rust, Go & systems languagestalk

Why Hacker News recommends it

HN recommends it as an eye-opening primer on benchmarking and performance analysis, especially for people who have not benchmarked on Linux.

What it is

Chandler Carruth walks through tuning C++ performance, from writing benchmarks to analyzing results on real CPUs and compilers. It focuses on small-scale problems such as loop kernels, data structures and algorithms, and on keeping compilers from optimizing benchmarks away.

Recommended by 3 HN commenters across 3 different months, 2015 to 2020.

What Hacker News said

Strong rec humanrebar · 2016-05 · on “Why I don't spend time with Modern C++ anymore”

Here's a few: - "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!" [this video] - "Understanding Compiler Optimization" [LINK] - "Optimizing the Emergent Structures of C++" [LINK] - "Efficiency with Algorithms" [LINK] The first one is really good if you've never benchmarked anything in a Linux environment. Or if you otherwise want to learn how to investigate how C++ gets turned into machine code.

Recommends kbenson · 2015-10 · on “Do you know how much your computer can do in a second?”

Interestingly, there's quite a bit that's needed to ensure you bypass some compiler optimizations. Here's an ey-opening (for me) talk[1] on benchmarking C++ and compilers which touched on it. 1: [this video]

Recommends thomashusa · 2020-03 · on “When Bloom filters don't bloom”

There is a very interesting talk [1] by Chandler Carruth that I stumbled upon last weekend that is very much related to this [1] [this video]

Cites misnome · 2019-08 · on “Why Const Doesn't Make C Code Faster”

> Anecdote: Optimum C blew away all the other C compilers on a magazine benchmark article because it figured out that the benchmark code did nothing and deleted it. I remember this problem being discussed in a CPPCon talk a few years ago, and some ways to "trick" the (modern) compilers into not optimising away the benchmark code - I think it was Chandler Carruth's "Tuning C++" talk: [this video]