Library / Computer / CMP-02
Computer
Amdahl’s law
Overall speed-up when only part of a job is accelerated.
- Ref
- CMP-02
- Rev
- v1
- Field
- Computer
- Result
- S [×]
S overall speed-up, p the fraction of the original execution time that is sped up (0 to 1) and s the speed-up factor of that part. Same workload, no extra overhead.
If you speed up only part of a job, the rest still takes its original time. The part you cannot accelerate sets a ceiling on the overall gain.
Calculator
- Ceiling as s → ∞2.5 ×
- Time saved52.5 %
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- Even with infinite resources, the speed-up cannot exceed 1/(1 − p). A job that is 90% parallel is capped at 10×.
- Optimising the biggest share of the run time pays more than optimising a small part by a huge factor.
- Real systems add overheads (communication, synchronisation) that make the result lower than this ideal.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (×) | Local step | Change in result |
|---|---|---|---|---|---|---|
| p Fraction accelerated | 0.1 to 0.99 | 1.096 | 7.477 | 6.381 | +undefined% | — |
| s Speed-up of that part | 1.5 to 1,000 × | 1.25 | 2.496 | 1.246 | +10% | +1.46 % |
Sweep of Speed-up of that part
| Speed-up of that part (×) | Overall speed-up (×) |
|---|---|
| 1.5 | 1.25 |
| 3.381 | 1.732 |
| 7.622 | 2.089 |
| 17.18 | 2.299 |
| 38.73 | 2.407 |
| 87.3 | 2.458 |
| 196.8 | 2.481 |
| 443.6 | 2.492 |
| 1,000 | 2.496 |
Sweep one variable
Variables and how each one contributes
Overall speed-up
What the equation gives you. Everything else feeds it.
Fraction accelerated
Share of the original run time that benefits. The dominant driver: raising p from 0.6 to 0.9 changes the ceiling from 2.5× to 10×.
Speed-up of that part
How much faster the accelerated part runs (e.g. number of cores). Shows strong diminishing returns beyond a modest value.
Worked example with the values above
- Unaccelerated share: 1 − p = 0.4. Accelerated share: p/s = 0.6 / 8 = 0.075.
- New time relative to old: 0.475.
- S = 1 / 0.475 = 2.105 ×.
Assumptions and limits
- Fixed workload and fixed problem size.
- No extra overhead for the accelerated part.
- Fraction p measured on the original execution time.
Common mistakes
- Defining p as a fraction of the new time.
- Expecting linear scaling with the number of cores.
- Using the instruction fraction instead of the time fraction.
Statistics and uncertainty
The accelerated fraction p is usually measured by profiling and carries ±5–10% uncertainty, which matters a lot near p = 1 because the ceiling 1/(1 − p) is very sensitive: a change from 0.95 to 0.90 halves the ceiling from 20× to 10×.
Where it is used
- Deciding whether an accelerator or extra cores are worthwhile.
- Signal-processing chain upgrades.
- Hardware and software co-design.
Maths you need
- Fractions: p is a share of the time
- Reciprocals: speed-up is old time over new time