CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"

CppCon · 119K views · 2016 · 55:49

Open on YouTube

Software performance & optimizationC, C++, Rust, Go & systems languagesAlgorithms & data structurestalk

Why Hacker News recommends it

Cited as the source for criticism of std::deque and move-constructor pitfalls, and as motivation to write custom data structures.

What it is

Chandler Carruth's CppCon 2016 talk on designing hybrid data structures for performance. He covers cache locality, working-set size and allocation overhead, and why standard C++ containers fall short.

Recommended by 1 HN commenters across 1 different months, 2016 to 2021.

What Hacker News said

Recommends typon · 2021-08 · on “EASTL: An Alternative C++ Standard Library”

I suggest watching this talk: [this video] Or pretty much any other by Chandler to understand why the STL sucks and why you should write better datastructures for your own use cases.

Cites chubot · 2016-11 · on “Help me sort out the meaning of “{}” as a constructor argument”

The parent was asking the goldilocks question -- was there ever a point where C++ was not too complex like modern C++, e.g. this {} issue, but had enough features (contrast with C, which doesn't have enough features for many applications). I don't think there was such a moment. Apparently move constructors were a de-optimization in the case of std::vector. As far as I remember, it's related to iterator invalidation and move semantics making small-size optimization impossible (e.g. inlining small vectors into the object itself rather than having another pointer and heap allocation). I'm pretty sure it's in this video: [this video] Although it's debatable how big a deal this is, it's a good example

Cites 04091948 · 2020-04 · on “Comparison of C++17, Go, and Java for a next-generation sequencing tool”

in CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"[1] he says: "but the standard deque data type is really quite bad. I wouldn't recommend anyone use it for anything. if you look at the implementation constraints, the constraints placed upon its iterators, and its invalidation constraints, it's painted into a very unpleasant corner and it has very few opportunities to be an efficient data structure." [1] [this video]