CPU design effects
summary
Examples identify concrete costs and fixes: a filter loop runs >2× faster on sorted data because branch mispredictions drop (about 100M vs 400k branch-misses measured with perf; VTune shows bad speculation), GCC sometimes replaces branches with conditional moves, Google Benchmark measures it. Pointer-spacing causes a 10× slowdown at 4096 bytes due to L1 cache associativity and millions of replacements, and certain float inputs trigger ~4× slowdowns via ~5M FP assists unless flush-to-zero / ffast-math is used.
AI-written summary · about
chapters (16)
- 0:00Start
- 3:51Hardware Effects
- 4:35Progress of Cpu Design
- 8:12Disclaimer
- 8:45Google Benchmark
- 12:17Why Is It Faster To Process a Sorted Array than an Unsorted Array
- 12:52Intel Amplifier
- 14:23Branch Predictor Unit
- 15:04Conditional Jump
- 19:00Branch Misses
- 20:00Profile Guided Optimization
- 22:26Compiler Explorer
- 29:49L1 Cache
- 33:39Index Bits
- 43:48Normal Floating Point Numbers
- 49:22Cpu Flags
related talks
01h 09mComputer Architecture, C++, and High Performance
01h 01mWant fast C++? Know your hardware!
01h 06mUtilize your CPU power
01h 00mJust-in-Time Compilation
01h 00mIntroduction to Hardware Efficiency in Cpp
49mThe Hidden Performance Price of C++ Virtual Functions
38mOptimized String Processing in RISC-V: How Toolchain Improvements Can Boost Performance
04mZero-Overhead Compiler Pessimization
