
CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"
About this video
Chandler Carruth's CppCon 2014 talk on writing fast C++, explaining why data structure choice and memory layout matter more than clever algorithms. It covers why standard containers like unordered_map perform poorly on modern CPUs.
Why it appears in the archive
A perennial recommendation for anyone learning performance optimization, cited whenever hash tables, cache behavior or STL containers come up.
AI-generated summary and labels from the source dataset; verify important details against the video. Source & credits.
From the Hacker News discussion
There are many things in the standard C++ library which are named incorrectly (std::string), awkwardly (std::unordered_map) and and implemented inefficiently from the perspective of modern CPUs (same std::unordered_map, which uses linked list for the underlying hash table buckets). See the great talk on CppCon 2014 about those issues - [VIDEO] .
Read original comment ↗Strongly agree. That's perhaps less true for the software I work on these days (lapack), but I've seen that so many times over my career. I'm also a big fan of "Efficiency with Algorithms, Performance with Data Structures" by Chandler Carruth at CppCon 2014. [VIDEO]
Read original comment ↗Chandler Carruth's CPPCon talk [0] this year was also great (surprisingly, as I had a fairly low opinion of most of the others). It wasn't better than Mike Acton's [1], but I suspect that it was more actionable for most devs. [0] [VIDEO] [1] [LINK]
Read original comment ↗Also, those allocations imply linked, rather than contiguous, data structures, which (often? always?) imply poor cache interaction, which is a major source of inefficiency. Would love some more perspectives on this, as I've just watched a couple cppcon talks ([0], [1]) and I'm feeling a bit drunk on the kool-aid. [0]: [VIDEO] [1]: [LINK]
Read original comment ↗Here's a few: - "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!" [LINK] - "Understanding Compiler Optimization" [LINK] - "Optimizing the Emergent Structures of C++" [LINK] - "Efficiency with Algorithms" [VIDEO] 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.
Read original comment ↗STL is not inherently slow per se, some data structures are just not fast on modern CPUs, so they have to be chosen wisely. Here is good talk: [VIDEO] .
Read original comment ↗Yes, if you write performance sensitive code you have to be very careful with dictionaries. See for example this nice talk by Chandler Carruth [VIDEO]
Read original comment ↗If you haven't already seen it, you'd probably really enjoy Chandler Carruth's "Efficiency with Algorithms, Performance with Data Structures" talk from CppCon 2014: [VIDEO]
Read original comment ↗