Amdahl Law
Maximum speedup from parallelizing a fraction of a task.
Formula
Live Calculator
MembersVariables
Example
Serial parts limit gains
How it works
Amdahl’s Law tells you the best possible overall speedup when only part of a workload can be accelerated. It works by splitting the original runtime into the fraction that stays serial, 1-p, and the fraction p that becomes s times faster, so the new total time is the sum of those two contributions: (1-p) + p/s. Taking the reciprocal gives the total speedup relative to the original single-core or unoptimized runtime.
When to use it
Use this when analyzing the benefit of parallel processors, GPUs, SIMD, or any optimization that speeds up only part of a program. It is especially useful for estimating diminishing returns and for deciding whether improving the parallel portion is worth the engineering effort.
Worked example, step by step
Suppose 80% of a program can be parallelized, so p = 0.8, and that part runs 5 times faster, so s = 5. Plug into Amdahl’s Law: S = 1 / ((1 - p) + p/s) S = 1 / ((1 - 0.8) + 0.8/5) S = 1 / (0.2 + 0.16) S = 1 / 0.36 S = 2.777... Final answer: the maximum overall speedup is about 2.78×.
Common mistakes to avoid
- Treating the speedup s as the overall speedup instead of the speedup of only the parallel fraction
- Using p as a percentage without converting it to a decimal, such as writing p = 80 instead of p = 0.8
- Assuming the total speedup can grow without limit even when a nonzero serial fraction remains
Did You Know?
Amdahl's law dooms parallel computing: if a tenth of a task is sequential, even infinite cores give at most a tenfold speedup.
Share this formula
More in Computer Science
View allShannon Entropy
AdvancedAverage information content of a random source (bits).
Master Theorem (form)
AdvancedAnalyzes running time of divide-and-conquer algorithms.
Hamming Distance
AdvancedNumber of positions at which two strings differ.
Bits to Represent n
BasicMinimum number of bits to represent n distinct values.
Binary to Decimal
BasicConverts a binary number to decimal.
Nodes in a Full Binary Tree
IntermediateTotal nodes in a perfect binary tree of height h.