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 allGustafson’s Law
IntermediateIdeal scaled-workload speedup when more processors allow a larger parallel task in the same elapsed time. Here s is the serial fraction of the parallel execution time, not the single-processor fraction used in Amdahl’s law.
Hick–Hyman Law (Equal Choices)
IntermediateModels choice reaction time for n equally likely alternatives (n ≥ 1). This information-theoretic form assumes comparable, practised stimulus–response choices; it is not a universal law of menu browsing.
Fitts’s Law (Shannon Form)
IntermediateAn empirical model of aimed movement time: farther or narrower targets generally take longer to reach. Use D ≥ 0, W > 0 and fitted coefficients for the device and task.
Shannon 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.