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

Channel:CppCon · Length:1:29:53 · Published:2015-09-27 · Views:188402

Watch on YouTube

Summary

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.

Why HN recommends it

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

Optimizing the Emergent Structures of C++ — HN, 2016

C, C++, Rust, Go & systems languages · Software performance & optimization

Subtitles (excerpt)

So I'm going to turn it over to our headliner: Chandler Carruth. Thank you. (applause) CHANDLER: Morning everybody How are you guys doing? Excellent, excellent! So everyone who is at the back, you're going to want to scoot up a bit, OK? This is fair warning! Guys, you might want to start that shuffle process now... You're going to want to be able to read very little bitty text up here, for the whole talk, OK. So, my name is Chandler Carruth, I'm here from Google where I'm the C++ and LLVM tech lead I do a lot of fun compiler stuff, I do a lot of fun programming language stuff at Google and I'm here to talk to today about tuning C++. When I say tuning C++ I mean tuning C++ for performance - like runtime performance we want to have really fast and efficient code It's one of the primary reasons why we still use C++ today is to get the last one and two percent of performance. I'm going to try to talk to you a little about how you can do that, I'm going to cover thing like benchmarking Some of the crazy things we see with CPUs Compilers (which are my bread and butter) All kind of crazy stuff Sound good? OK there are a couple of caveats. The first caveat is, and I actually do feel a little bit bad about this,

On Hacker News

Here's a few: - "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!" [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 cod… — humanrebar, 2016-05
There is a very interesting talk [1] by Chandler Carruth that I stumbled upon last weekend that is very much related to this [1] [VIDEO] — thomashusa, 2020-03
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: [VIDEO] — kbenson, 2015-10
> 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: [VIDEO] — misnome, 2019-08

Related videos