Toolvito

Works on this device

CPU Core Scaling Calculator

See how well a program uses more processor cores. Enter the run times you measured at several core counts. The tool shows the speedup and the efficiency for each count, draws them against the ideal line, and can fit Amdahl's law to predict more cores.

Enter your values

You ran the same job on different numbers of cores. See the speedup and the efficiency for each core count.

Your values
Measured runs

One row for each core count you measured. The starting rows are an invented example: replace them with your own run times. Use the same program, input and settings for every row.

This unit is used in every row.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Run the same job on different numbers of cores and note the run time of each.
  2. Choose Strong scaling when the amount of work was the same in every run. Choose Weak scaling when the work grew in step with the cores.
  3. Replace the example rows with your own: the cores used and the run time. Pick the unit for the run times above the rows.
  4. Choose Calculate. The table and the chart show each core count against the ideal.
  5. Choose Fit Amdahl's law to find the serial part of the job and a prediction for more cores.

The formulas

  • Speedup = run time of the baseline ÷ run time. The baseline is the row with the fewest cores.
  • Efficiency = speedup ÷ (cores ÷ cores of the baseline) × 100.
  • Karp-Flatt serial fraction = (1 ÷ speedup − 1 ÷ cores) ÷ (1 − 1 ÷ cores). It needs a baseline of one core.
  • Weak scaling efficiency = run time of the baseline ÷ run time × 100. Scaled speedup = (cores ÷ cores of the baseline) × that ratio.
  • Fit: run time = serial time + parallel work ÷ cores. The two numbers come from least squares: the straight line of run time against 1 ÷ cores with the smallest sum of squared gaps.

Worked example

The example rows are 120 s on 1 core, 64 s on 2, 36 s on 4, 22 s on 8 and 15.5 s on 16. On 16 cores the speedup is 120 ÷ 15.5 = 7.742 times and the efficiency is 7.742 ÷ 16 = 48.4%. The Karp-Flatt serial fraction is 6.67% up to 8 cores and 7.11% on 16.

The fit gives a serial time of 8.208 s and parallel work of 111.72 s, so 93.16% of the job is parallel. The limit of the speedup is 119.929 ÷ 8.208 = 14.61 times. For 64 cores the fit predicts 9.954 s, a speedup of 12.05 times.

Limits you should know

  • The example rows are invented. They are not measurements of any real processor or program.
  • Use the same program, input and settings for every row, and repeat each run. Single run times vary.
  • Cores are not all equal. Extra threads on the same core, slower efficiency cores, heat and shared memory all lower the speedup, and the tool cannot see them.
  • A prediction far beyond the cores you measured is a rough guide. Real programs lose more as the cores go up than the model allows for.
  • For the law itself, without measurements, use the Amdahl Law Calculator.

Related tools