performance
Amdahl's Law
Why throwing more CPUs at a problem doesn't give you proportional speedup.
Tiny Summary
Amdahl's Law proves that speedup from parallelization is limited by the serial portion. If 10% must run serially, your maximum speedup is 10x—even with infinite CPUs.
The Formula
Speedup = 1 / (s + p/n)
s = serial fraction
p = parallel fraction (1 - s)
n = number of processors
The Bottleneck
- 10% serial → max 10x speedup
- 25% serial → max 4x speedup
- 50% serial → max 2x speedup
100 CPUs won't give you 100x speedup if ANY part is serial.
Real Examples
Database: Parse SQL (serial) + scan partitions (parallel) = limited scaling Video Encoding: Header processing (serial) + encode frames (parallel) = good scaling Web Scraping: Rate limiting (serial) + fetch pages (parallel) = moderate scaling
Key Insight
More CPUs ≠ proportionally faster. Serial portions create hard limits regardless of hardware.
Use the simulation to experiment with different serial/parallel ratios!