Skip to content
Omnikalc

How much faster will more processors make your program?

Enter the parallel share of the work, the number of processors and a target speedup: get the speedup, the efficiency, the maximum possible speedup and the processors needed for the target.

Updated on
Your inputs
%

Value out of range

Value out of range

×

Value out of range

Results

Speedup with these processors

4.71 ×

Processors needed for the target speedup

9

Number of processors needed to reach the target
Parallel efficiency
58.8%
Moderate efficiency: returns from extra processors are diminishing
Maximum possible speedup (infinite processors)
10.0 ×

Amdahl’s law gives the best speedup you can expect when you run a program on several processors. Some parts of a task can be split among processors, but others, such as reading input or combining results, must run in sequence. The serial part sets a ceiling on the speedup, whatever the number of processors. The law is used to decide whether it is worth buying more cores or better to improve the code.

How the calculation works

With a parallel fraction p and n processors:

  • Speedup = 1 ÷ ((1 − p) + p ÷ n)
  • Maximum speedup = 1 ÷ (1 − p)
  • Efficiency = speedup ÷ n
  • Processors for a target speedup S = p ÷ (1 ÷ S − (1 − p)), if the target is below the maximum

Example

If 90% of a program can run in parallel, 8 processors give a speedup of 1 ÷ (0.1 + 0.1125) = 4.71, an efficiency of 58.8%. The maximum speedup is 10×, however many processors are added. To reach a 5× speedup, you need 9 processors.

Diminishing returns

With a 90% parallel part, going from 8 to 16 processors raises the speedup only from 4.7 to 6.4, and 1,000 processors give 9.9. The last 1% of serial work costs more than all the others combined. This is why optimizing the serial part is often more profitable than adding hardware.

Limits of the model

Amdahl’s law assumes a fixed problem size. Many tasks get larger when more processors are available, and in that case the parallel part grows, which is the idea behind Gustafson’s law. Real programs also face overheads, so measure speedup on your own workload and use the law as an upper bound for planning.

When to optimize instead

Before adding processors, profile the program to find the serial parts: loading data, locks, single-threaded libraries and final merging. Reducing the serial share from 10% to 5% lifts the ceiling from 10× to 20×, a gain that no amount of extra hardware could match on the original code.

Frequently asked questions

What does Amdahl's law say?

The speedup of a program from adding processors is limited by the part that cannot run in parallel.

What is the maximum speedup?

1 divided by the serial fraction. With 10% serial work, no number of processors can give more than a 10× speedup.

Does this include overheads?

No. Real programs also lose time to communication, synchronization and memory limits, so actual speedup is lower.

What about Gustafson's law?

Gustafson's law assumes the problem grows with the number of processors. Amdahl's law assumes a fixed problem size.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.