2013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++

Channel:CppNow · Length:1:33:01 · Published:2013-06-09 · Views:34461

Watch on YouTube

Summary

Chandler Carruth's CppNow 2013 keynote on how C++ builds complex software from simple emergent structures, and how compilers optimize them through inlining and value semantics.

Why HN recommends it

HN lists it among C++ optimization talks and cites it for how much optimizer performance comes from inlining, from an experienced compiler engineer.

See also this recent presentation by someone who has a lot more experience than me with writing compiler backends — HN, 2013

C, C++, Rust, Go & systems languages · Software performance & optimization · Compilers, interpreters & program analysis

Subtitles (excerpt)

thank you so much well it's really good to be here our folks marginally awake you guys you guys start Things Early here I'm I'm still catching up um it's really good to be here I'm here to talk about optimizing emergent structures which um seems a little bit of a strange topic so I'm going to start off by trying to explain where I'm coming from and what what I'm what I'm really focused on I I have this idea about C++ uh one of the things that I really like about it is that with C++ you write a very small piece of code in one place someone else some other team some other part of your company writes another very small piece of code this happens a lot right it happens over and over again and as you write these small pieces of code something starts to develop that's that's quite remarkable arable it a very large system a very complex system starts to develop even though each person right each person's writing a small reasonably isolated piece of code and C++ makes this so easy and so powerful because it combines objectoriented programming generic programming templates all the things you need to really really leverage this however it turns around and presents really unique challenges to optimizing that code a lot of people started writing C++ not

On Hacker News

Here's a few: - "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!" [LINK] - "Understanding Compiler Optimization" [LINK] - "Optimizing the Emergent Structures of C++" [VIDEO] - "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
I don't claim to have any answers, but I found all of this interesting and surprising. I wondered about a couple of things. What happens if the do_stuff_to_foo is actually defined (and what happens in that actual function)? And is there a difference between value semantics and pointer/reference semantics? These questions were my take-away from one of Chandler Carruth's C++ compiler optimization t… — dottrap, 2018-06
> That said, avoiding libraries (especially avoiding templates and just using void*-like stuff) does keep binaries/libs smaller, but I'll gladly make the computer work slightly harder considering that the result is the same speed (C++ is often faster than C, in practice). This should not be an issue with modern C++ compilers. If two template instantiations generate the same or similar code, they … — mihai_ionic, 2013-08

Related videos