Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!
summary
Live microbenchmarks use google/benchmark and show 22M iterations reporting ~32ns but still noisy; reserving a vector unexpectedly makes push_back about ten times faster in one example. Analysis uses perf recordings, annotated assembly and callgraphs, plus an inline-assembly escape to prevent optimizer elimination; profiling requires -fno-omit-frame-pointer for reliable stacks. Sampling can misattribute cost (modulo attributed to a store), LBR has tradeoffs, and Intel Architecture Code Analyzer helps validate where hot cycles actually occur.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:01Tuning C++ Benchmarks, and CPUs, and Compilers! Oh My!
- 2:20Performance Matters
- 3:30What C++ code should you tune?
- 9:43Measure first, tune what matters
- 10:14Macro Benchmarking
- 10:42Micro Benchmarks
related talks
45mPerformance Benchmarking with Celero
01h 01mPlenary: Performance Matters
01h 37mAn Overview of Program Optimization Techniques
49mAn Engineering Approach to Optimising C++
57mC++ MythBusters Strike 2
01h 06m“Improving Performance Through Compiler Switches..."
01h 00mMoving Faster: Everyday efficiency in modern C++
58mRefresher on Containers, Algorithms and Performance
