What is Amdahl's Law?

Amdahl's Law, named after computer architect Gene Amdahl, is a formula used to find the maximum expected improvement to an overall system when only part of the system is improved.

It's particularly useful in parallel computing to calculate the theoretical speedup when using multiple processors.

Amdahl's Law Formula

S = 1 / ((1 - P) + (P / N))

Where:

Variable Description Range
S Theoretical Speedup S ≥ 1
P Parallel portion of the program (decimal) 0 ≤ P ≤ 1
N Number of processors/cores N ≥ 1
1 - P Serial portion of the program 0 ≤ (1-P) ≤ 1
0% (Fully Serial) 100% (Fully Parallel)
1 64

Speedup Comparison

Real-World Examples

Video Encoding

Parallel Portion (P): 0.85 (85% can be parallelized)

Typical Processors: 8 cores

Maximum Speedup: 4.7x (Amdahl's Law limitation)

Even with perfect parallelization of encoding algorithms, file I/O remains serial.

DNA Sequencing

Parallel Portion (P): 0.95 (95% can be parallelized)

Typical Processors: 32 cores

Maximum Speedup: 12.3x

Sequencing individual segments can be parallelized, but assembly remains serial.

Game Physics

Parallel Portion (P): 0.70 (70% can be parallelized)

Typical Processors: 6 cores

Maximum Speedup: 2.3x

Physics calculations can be distributed, but game state synchronization is serial.

Key Insights from Amdahl's Law

Diminishing Returns

Adding more processors provides less benefit as P approaches 1. Even with P=0.95, infinite processors only give 20x speedup.

Serial Bottleneck

A program with just 10% serial code (P=0.9) can never achieve more than 10x speedup, regardless of processor count.

Over-Parallelization

Adding processors beyond a certain point yields minimal improvements. Focus on reducing serial portions first.

Optimization Priority

Improving the serial portion (1-P) has a much greater impact than adding more processors when P is already high.