An Amdahl's law calculator shows how much faster a task gets when you speed up only part of it. It answers the question of whether it is worth making one step faster, or adding processors, when the rest of the work stays the same. Enter the share of the running time that benefits and how much faster it becomes, and you get the overall speedup, the highest speedup that is possible, and the running time that remains. It runs in your browser.
How to use the Amdahl's law calculator
- Choose the speedup of a part, processors or target mode.
- Enter the share of time that benefits, in percent.
- Enter how many times faster that part becomes, or the number of processors, or your target.
- Press Calculate.
The formula
The Wikipedia article on Amdahl's law gives the overall speedup as S = 1 ÷ ((1 − p) + p ÷ s). Here p is the fraction of the execution time of the task that would benefit from the improvement of the resources, and s is the factor by which that part is accelerated.[1] It comes from adding the times: the part that does not benefit keeps its time, the fraction 1 − p, and the part that benefits takes p ÷ s of the original time.[1] A task with 30 percent of its time sped up by a factor of 2 runs in 0.7 + 0.15 = 0.85 of the time, so the speedup is 1 ÷ 0.85 = 1.18, which is the example that the page gives.[1]
The limit
The page says that as the improvement grows without limit, the total throughput heads toward the limit of 1 ÷ (1 − p), and that even with an infinite number of processors, the speedup is constrained by the part that cannot be sped up.[1] So if only 50 percent of the work can be parallelized, the best possible speedup is 2 times, and if 95 percent can be, the best possible speedup is 20 times.[1] The calculator shows this limit with every result. It is the main lesson of the law: the part that you do not improve decides how far you can go.
More examples from the article
The article notes that a part that takes 10 percent of the time, made 10,000 times faster, gives an overall speedup of only 1.11, while a part that takes 99 percent of the time, made 100 times faster, gives a speedup of about 50.[1] It also gives a case with two steps, A taking 3 seconds and B taking 1 second. Making B five times faster, which is p = 0.25, gives a speedup of 1.25, which is 20 percent faster. Making A twice as fast, which is p = 0.75, gives 1.60, which is 37.5 percent faster.[1] The larger step is the better one to improve, even if the improvement is smaller. Enter these numbers to check the calculator.
Using several processors
For a task that can be split among N processors, the improved part gets N times faster, so the formula becomes 1 ÷ ((1 − p) + p ÷ N). This is the formula with s = N, and it is not written separately on the page. For a task that is 90 percent parallel and 8 processors, the speedup is 1 ÷ (0.1 + 0.1125) = 4.71. The efficiency is the speedup divided by the number of processors, here 58.8 percent, and it falls as processors are added. With 80 processors, the speedup is only 8.8, and the limit is 10. The calculator shows the efficiency in the processor mode.
What speedup do you need?
The target mode works backward. If 90 percent of the time can benefit and you want an overall speedup of 5, the improved part must become p ÷ (1 ÷ target − (1 − p)) = 0.9 ÷ (0.2 − 0.1) = 9 times faster. If the target is at or above the limit, which is 10 here, no speed of the improved part can reach it, and the calculator says so. The same is true for a target of exactly 10, which would need an infinite speedup. This is useful when you are deciding how much to invest in an improvement.
Beyond computing
The law applies to any process with steps. If a factory line has one slow step that takes half of the time, speeding up the other steps cannot make the line more than twice as fast. If you do the shopping in an hour and half of it is a drive that you cannot shorten, then even instant shopping would only save half of the time. The idea is to find the part that dominates the time, and to see what share of the total it is.
Limits of the law
The law uses a fixed workload. If a bigger machine lets you solve a bigger problem, the share that is parallel may grow, and the speedup may be better than the law says. Also, real parallel work has costs for coordination, so the true speedup is often lower. Use the result as an upper bound on the speedup for the same job, and measure real programs to see how they behave.
Common mistakes
- Using the share of the code instead of the share of the time. The p must be the share of the running time.
- Expecting a speedup beyond the limit. The part that does not improve caps it.
- Entering the percentage as a fraction. Type 30, not 0.3.
- Ignoring the cost of coordination. The law gives an upper limit.
What next
Use this often? Add Amdahl's Law to your Home screen.
Frequently asked questions
What is an Amdahl's law calculator?
A tool that gives the overall speedup of a task when a part of it is made faster, using the share of the time that benefits and the factor of improvement.
What is Amdahl's law?
The overall speedup is 1 ÷ ((1 − p) + p ÷ s), where p is the share of the running time that benefits and s is how much faster it gets.
What is the maximum speedup?
1 ÷ (1 − p). If 95 percent of the work can be parallelized, the best possible speedup is 20 times.
What is the speedup if 30 percent of the time is made twice as fast?
1 ÷ (0.7 + 0.15) = 1.18.
Why does adding processors give less and less speedup?
The part that cannot be split stays the same, so each extra processor helps a smaller share of the total time.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.