Moving Faster: Everyday efficiency in modern C++
summary
Argues that performance almost always matters and gives concrete fixes: count heap allocations, treat cache misses as the new floating point divides, prefer stack or embedded storage and short‑string optimizations to reduce allocations, and use C++17 features like node extraction and merge to move elements between associative containers without reallocating. Shows microbenchmarks (vector vs deque vs list for inner sizes 10, 100, 1000) and examples where rewriting a 3‑week job to 5 hours or shrinking 2,700 tests from 70 minutes to ~20 seconds is possible by using emplace to construct in place, correct passing conventions, and fewer allocations.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:50A 30 Year Tale
- 3:03When does efficiency matter?
- 6:28Writing optimal code
- 8:55Dynamic allocation
- 9:55Static allocation
- 10:44Embedded objects
- 12:49Sharing space
- 14:29Pass by value
- 15:31Pass by const reference
- 16:44Pass by non-const reference
- 17:28Passing vector by value
- 20:02Passing vector by r-value reference
- 22:05Passing vector by non-const reference
- 22:48Return rules
- 26:06Moving a string
- 29:15Not moving
- 30:21Constructing in place
- 32:16Splicing
- 32:41Node Extraction
- 33:48Changing an Element key
- 35:37Merging Sets
- 38:12Add - A Case Study
- 42:04Container Choice
- 45:03Vector vs. Array vs. C-array
- 47:26List vs. Deque vs. Vector
- 49:28Set/Map vs. Vector
- 50:30Set vs. Vector
related talks
58mC++ Performance and Optimisation
44mC++ Performance and Optimisation
05mMaximising Throughput & Minimising Latency in High-Performance C++ Code
01h 05mFast and small C++ - When efficiency matters
58mRefresher on Containers, Algorithms and Performance
01h 01mRefresher on Containers, Algorithms and Performance in C++
55mWriting Cache-Friendly C++
01h 00mOLD VERSION: The Fine Details Behind C++ Containers And Algorithms
