C++ Performance and Optimisation
summary
Argues that optimization is a measured process: profile to remove obvious waste, then eliminate hot mallocs and temporaries, then choose algorithms and data layout. Shows examples: a telephony case with 130 mallocs per request that collapse when memory is preallocated, 10 million push_backs drop to one allocation with reserve, CPU vectorization yielding about vectorization 2.5x speedup, and dense storage beating pointer structures by a factor of 7–8 between dense and pointer-based; move semantics and unique_ptr remove copies and allocation overhead.
AI-written summary · about
chapters (17)
- 0:00C++ performance myths
- 2:18Performance as a process
- 4:24Eliminating waste
- 6:55Real algorithms after cleanup
- 9:03Modern CPU complexity
- 13:00Memory bandwidth and cache
- 16:35Algorithm complexity and small numbers
- 17:57Data layout and cache-friendly
- 22:28Move semantics and C++11
- 26:02Memory allocation costs
- 28:08Container choice and bandwidth
- 30:13Hashing and comparison optimizations
- 32:49Domain knowledge and profiles
- 33:10Key access patterns
- 36:45Read/write ratios and cache coherence
- 38:52Working set size and cache fit
- 40:58Summary and process
related talks
01h 00mMoving Faster: Everyday efficiency in modern C++
05mMaximising Throughput & Minimising Latency in High-Performance C++ Code
01h 01mRecipes for Reducing Allocations by C++ Containers
52mC++ Performance Tips - Cutting Down on Unnecessary Objects
35mAlgorithmic and microarchitecture optimizations of C++ applications
01h 01mGetting Allocators out of Our Way
01h 08mHeaps Don’t Lie - Guidelines for Memory Allocation in C++
01h 00mOLD VERSION: The Fine Details Behind C++ Containers And Algorithms
