An Overview of Program Optimization Techniques
summary
Covers what hardware actually does (pipelining, out‑of‑order, superscalar ports, caches, NUMA and SMT) and when manual changes help: use Sandy Bridge microarchitecture examples, Godbolt assembly to show inlining reduces stack traffic on 32‑bit ABIs, and hwloc/perf/VTune to find stalls and false sharing. Gives concrete costs (floating‑point divide ~20 cycles, integer divide ~40 cycles), shows tiling, loop unrolling, SIMD/AVX intrinsics and metaprogrammed FFTs that significantly speed up numeric kernels, and explains Newton‑Raphson reciprocal/sqrt tricks (the famous inverse square root (Quake III)) and when to trust the compiler versus hand optimization.
AI-written summary · about
chapters (28)
- 0:00Introduction
- 1:40What is optimization
- 4:40X86 optimization
- 6:30Assembly
- 16:17Port Types
- 17:07Auto Order Execution
- 19:08Avoid Stalls
- 19:43Not all instructions are equal
- 20:17Relative instruction speed
- 21:47SIMD
- 24:27Multithreading
- 30:17Complex Switches
- 31:53Caches
- 35:54Compact Objects
- 36:49Padding
- 37:08Branch prediction
- 38:37Branch code
- 39:41Static branch prediction
- 44:30Inlining
- 45:28ABI Cost
- 48:20Specialized Optimization
- 49:02Metaprogramming
- 51:32Explicit Load
- 52:58Unrolling
- 53:30Overload
- 54:10Advanced Optimization
- 56:12Loop Optimization
- 58:30Register Rotation
related talks
01h 06mPerformance engineering: being friendly to your hardware
01h 05mPerformance Optimization in Software Development - Being Friendly to Your Hardware
58mOptimization Tips - Mo' Hustle Mo' Problems
01h 30mTuning C++: Benchmarks, and CPUs, and Compilers! Oh My!
01h 01mPlenary: Performance Matters
01h 04mDesign for Performance
42mPractical Optimizations
54mx86 Internals for Fun & Profit
