Skip to content
0:00 / 0:00

#hybriddatastructures#cachelocality#llvm

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

CppCon

189K subscribers • 103 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 1 on Hacker News and 1 in engineering communities.
  • A classic. People kept recommending it from 2017 to 2021.
  • Presented by Chandler Carruth
  • Linked in the descriptioncppcon/cppcon2016
  • An opinion. It argues one side of a question engineers disagree on.

Advanced. Deep dive for people who know the field.

119K views10 years ago2 recommendations

Systems programmingProgramming languagesC++Performance and optimizationData structures

Chandler Carruth explains how to design high-performance hybrid data structures in C++ to optimize cache locality and avoid memory allocation overhead.

CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/cppcon/cppcon2016 — Modern programs’ performance characteristics are often dictated by their data. Whether the cache locality of data access, the size of working set, or avoiding costly memory allocation overhead. Unfortunately, the standard C++ library data structures range from adequate to terrible at controlling these aspects, and they don’t provide any of the core mechanisms needed for extremely efficient data structure design. This talk will present the core concepts of designing high performance data structures in C++. It is based on years of experience in the LLVM compiler as well as several other large code bases. From these principles, the talk will propose a suite of data structures that provide performance without loss of generality or functionality. As much as this talk will present specific data structure designs, its primary intent will be to give an understanding of what makes these structures have greater performance than more naive approaches. — Chandler Carruth Google C++ Lead San Francisco Bay Area Chandler Carruth leads the Clang team at Google, building better diagnostics, tools, and more. Previously, he worked on several pieces of Google’s distributed build system. He makes guest appearances helping to maintain a few core C++ libraries across Google’s codebase, and is active in the LLVM and Clang open source communities. He received his M.S. and B.S. in Computer Science from Wake Forest University, but disavows all knowledge of the contents of his Master’s thesis. He is regularly found drinking Cherry Coke Zero in the daytime and pontificating over a single malt scotch in the evening. — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf

Why it's here

2 people recommend this

What people say. Recommended for understanding why standard C++ containers can be inefficient and how to design better custom data structures.

u/oilshellin r/ProgrammingLanguages • Recommends

CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures" link to this video

typonon Hacker News • Recommends

On “EASTL: An Alternative C++ Standard Library”

I suggest watching this talk: link to 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.

u/oilshellin r/ProgrammingLanguages • Mentions

On “(C/C++) What are some performance pitfalls for a VM?”

I'm still in the early stages of my VM, but I like CppCon videos for performance tips. For example: [CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"] [CppCon 2014: Drew Paroski "How HHVM Uses Modern C++ for Fun and Profit (Literally)"] The first one is about the data structures LLVM uses, and I trust that since it's been heavily used and iterated on. At a high level, the main strategy I'm following is to "compress" data structures as much as possible and avoid pointer chasing where possible. CPython is kind of the opposite of this -- it very large objects with a lot of indirection with pointers due to the meta-object protocol: ``` Python 3.5.2 >>> fo…

u/skeetoin r/C_Programming • Mentions

On “Why is there no C conference?”

Every year you can think of a subset of CppCon as being like a C conference. There are a bunch of presentations that are entirely or mostly relevant to C, and not just in a broader sense of being relevant to *any* language. I plucked out a bunch from CppCon 2017 for you. These are *roughly* ordered from best to worst: * [Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”] * Chandler Carruth “Going Nowhere Faster” * James McNellis “Everything You Ever Wanted to Know about DLLs” * John Regehr “Undefined Behavior in 2017 (part 1 of 2)” * John Regehr “Undefined Behavior in 2017 (part 2 of 2)” * Piotr Padlewski “Undefined Behaviour is awesome!” * [Tob…

chuboton Hacker News • Mentions

On “Help me sort out the meaning of “{}” as a constructor argument”

…nt. 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: link to this video Although it's debatable how big a deal this is, it's a good example of the point. People like "C with classes" because they can read the source and kind of figure out what code is generated. They can reason about locality. Although I don't consider myself an expert C++ programmer, if I can't reason about the consequences of move constructor…

04091948on Hacker News • Mentions

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 link to this video