Computer architecture
Amdahl's law
Also called: Amdahl · parallel speed-up · serial fraction
Definition
Amdahl's law says the overall speed-up from improving part of a task is limited by the fraction of time that part takes.
Picture it
If 40 % of a program cannot be sped up, even an infinitely fast fix for the other 60 % only makes it 2.5 times faster. Measure first, then optimise the part that actually dominates.
The maths
speed-up = 1 / ((1 − p) + p / s) p = fraction improved, s = speed-up of that fraction
| Quantity | Unit | Symbol |
|---|---|---|
| ratio | dimensionless | 1 |
Worked example
60 % of a vision pipeline is made 4 times faster. What is the overall speed-up? What is the limit if that part became infinitely fast?
- 1 / (0.4 + 0.6 / 4) = 1 / 0.55 = 1.82
- Limit: 1 / 0.4 = 2.5
AnswerAbout 1.82 times faster; never more than 2.5 times.
✓ The 2 numbers in this answer are recomputed from scratch by an automated test.
Common misconceptions
- Misconception: Adding more cores does not give a proportional speed-up unless almost all the work is parallel.
- Misconception: Optimising a function that takes 2 % of runtime cannot help much.