Calculate speedup in parallel computing

Tan Bui
2 min readMay 15, 2021

Amdahl’s law is a formula to calculate the theoretical speedup in the execution time of a task when the system resources can be improved. This is important in cloud computing where resources are easily scaled out, as it helps to calculate that adding how many resources (i.e. CPUs for parallel computing) would result in a better performance.

The formula is

Where:

  • S-overall is the max of how many times that parallel computing could be faster than single-thread performance.
  • f is the fraction of the algorithm that can be parallelized.
  • S-part is the corresponding speedup.

For example: task A needs 20 hours to complete using a single thread. There is a 1-hour portion of the task that cannot be parallelized and the remaining 19 hours of execution time can be parallelized (f = 19/20 = 0.95).

When increasing the number of processors to S-part = 64 for parallel processing, the maximum speed up is 1/( (1–0.95) + 0.95/64 ) = 15.42 times, compared to single processing.

Speedup of different parallel portions — Source: wikipedia

--

--

Tan Bui

Software Engineer @Smartly.io, phototaker, naturelover.