Amdahl's Law


Amdahl's Law is a general technique for analyzing performance when execution time can be expressed as a sum of terms and you can evaluate the improvement for each term.

An Example

Suppose you are redesigning a processor, improving its performance on memory operations and branches. Before the improvement, memory operations accounted for 30% of the execution time and branches accounted for 20% of the execution time. The performance on memory operations is improved by 50% and the performance on branches is improved by 100%. What is the overall performance improvement, expressed as a percentage?

To solve this, you can draw timelines representing the before and after execution times, broken down into components. The units that you use in your timelines won't affect improvement ratios or percentages as long as you use the same units for both timelines. When you are given a percentage breakdown of the execution time before the modification it is convenient to use 1% of the total before execution time as a unit.

Here is the before timeline.

Others Memory Branches
50 30 20

In the after timeline, the "Other" part is unchanged. The "Memory" part is divided by a factor of 1.5 (1 + 50/100) and the "Branches" part is divided by a factor of 2 (1 + 100/100).

Here is the after timeline.

Others Memory Branches
50 20 10

Then the overall performance improvement ratio (the reciprocal of the execution time ratio) is 100/80 = 1.25. That is a 25% improvement.