Fastware
summary
Argues concrete wins and losses from low-level changes: using replace branches with arithmetic (an “optional” mask trick) removes mispredicted branches and yields up to ~2× speed on random and real Google word-frequency data but causes 16–18% slowdowns on sorted or organ‑pipe inputs; shows binary-search insertion is slower than linear search due to branch misprediction; benchmarks use C#/C++ backends, multiple data shapes (random, random 0/1, sorted, organ pipe, real), Godbolt disassembly and Intel VTune, and recommends measure on representative inputs and use the optional mask trick carefully.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:57Mind Amdahl's Law
- 15:36Optimizing Rare Cases
- 15:47Today's Computing Architectures
- 21:52Reliable Heuristics
- 31:25Benchmarking Speed
- 38:54Replace Branches with Arithmetic
- 43:24Sense & Sensibility
- 44:37Reduce Dependencies
- 45:26One Induction Variable
- 46:51Get rid of multiplication by 3
- 47:46Enter optional
- 55:01Replace branches with optional
related talks
01h 04mBranchless Programming in C++
01h 05mPerformance Optimization in Software Development - Being Friendly to Your Hardware
01h 02mSqueezing the Hardware to Make Performance Juice
01h 06mPerformance engineering: being friendly to your hardware
01h 00m“Want fast C++? Know your hardware!"
05mCache Warming: Warm Up The Code
01h 02mMaking the Most Out of Your Compiler
38mAsserting Your Way to Faster Programs
