What is Amdahl's law?

The law that when only part of a program is parallelized, overall speedup is limited by the part that cannot be. For example, parallelizing 90% gives at most a 10x speedup.

Field: CPUs and architecture

Japanese name: アムダールの法則

The formula and its ceiling

Amdahl's law gives the speedup of a program whose fraction p can be parallelized across N processors asS=1(1−p)+pNS = 1 / ((1 − p) + p/N). As N grows without limit, the p/N term vanishes and the speedup approaches 1 / (1 − p). With p = 0.9 that ceiling is 10×, and with ten processors the result is only about 5.3×, so half the hardware is effectively wasted. The serial fraction, however small it looks, ends up dominating the run time once the parallel part has been divided finely enough.

Same law, any kind of speedup

The law applies to any partial improvement, not just to adding cores. If a section taking 50% of the run time is made 4× faster, the new time is0.5+0.54=0.6250.5 + 0.5/4 = 0.625of the original, an overall speedup of 1.6×, and no amount of further optimization of that section can exceed 2×. Making a part that takes 1% of the time infinitely fast gains only about 1%. This is the quantitative basis of "make the common case fast" and the reason to profile a program before optimizing it.

Amdahl's law vs. Gustafson's law

Amdahl's law assumes a fixed problem size, which corresponds to strong scaling: the same job is split across more processors. Gustafson's law assumes the opposite: with more processors, people solve a larger problem in the same time, for example a finer simulation grid. The parallel work grows with the problem while the serial part stays roughly constant, so the serial fraction shrinks and speedup grows almost in proportion to the processor count. This is weak scaling. Neither law is wrong; they answer different questions about how a workload is used.

Why real programs do worse than the formula

Amdahl's law already assumes the parallel part scales perfectly, so measured speedups are usually lower still. Threads wait at locks and barriers, shared data and false sharing make cache lines bounce between cores, uneven work leaves some cores idle, and many threads can saturate memory bandwidth. Communication and synchronization overhead can even grow with N, so adding cores may eventually slow a program down. The cleanest scaling comes when each thread works mostly on private data, with little communication or waiting.

Try it: questions about Amdahl's law

A part taking 50% of total time is made 4× faster. What is the overall speedup (Amdahl's law)?

  1. A2×
  2. B1.6×
  3. C4×
Show answer and explanation

Answer: B. 1.6×

The new time is the unchanged 50% (0.5) plus the accelerated 50% (0.5 ÷ 4 = 0.125), totaling 0.625. The speedup is 1 ÷ 0.625 = 1.6×. No matter how much the improved part is accelerated, the other 50% remains, so the overall speedup can never exceed 2×. Large overall gains require finding and improving the parts that take most of the time.

Which lesson about how to approach performance improvement follows best from Amdahl's law?

  1. APrioritize speeding up the parts that take most of the time (the common case)
  2. BSpeed up rarely executed parts first
  3. CSpeeding up any part has the same effect on the whole
Show answer and explanation

Answer: A. Prioritize speeding up the parts that take most of the time (the common case)

Making a part that uses 1% of the time infinitely fast speeds up the whole by only about 1%. Doubling the speed of a part that uses 80% yields about 1.7× overall. So the basic approach is to find where time is spent, for example with a profiler, and improve that first. "Make the common case fast" is a principle used again and again in computer design.

FAQ

How do you calculate speedup with Amdahl's law?

Divide 1 by the new relative run time:S=1(1−p)+psS = 1 / ((1 − p) + p/s), where p is the fraction of time affected and s is how much faster that part becomes (s = N for N processors). For p = 0.5 and s = 4 this gives 1 / 0.625 = 1.6×.

What is the maximum speedup if 95% of a program is parallel?

The limit is 1 / (1 − 0.95) = 20×, no matter how many processors are used. Reaching even close to that limit requires very large processor counts and near-perfect parallel efficiency.

What is the difference between Amdahl's law and Gustafson's law?

Amdahl's law fixes the problem size and shows that the serial part caps speedup. Gustafson's law lets the problem grow with the number of processors, so the serial fraction shrinks and near-linear scaled speedup becomes possible.

Questions that mention Amdahl's law (4)

Amdahl's law appears in 6 practice questions across 3 topics, including Performance Analysis, CPUs and architecture, Multicore & Synchronization.

  1. If 90% of a program can be parallelized, what is the theoretical maximum speedup when it runs on an unlimited number of processors?
  2. Which is NOT a reason a parallel program fails to scale as cores are added?
  3. What idea does Gustafson's law express?
  4. What is the purpose of using a profiler when improving program performance?

Books on CPUs and architecture Ad

As an Amazon Associate I earn from qualifying purchases.

Comparisons that include this term

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary