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.
Japanese name: アムダールの法則
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.
Japanese name: アムダールの法則
Amdahl's law gives the speedup of a program whose fraction p can be parallelized across N processors as. 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.
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 isof 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 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.
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.
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.
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.
Divide 1 by the new relative run time:, 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×.
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.
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.
Amdahl's law appears in 6 practice questions across 3 topics, including Performance Analysis, CPUs and architecture, Multicore & Synchronization.
As an Amazon Associate I earn from qualifying purchases.
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.