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. It involves drawing time lines for execution before and after the improvement. Then their length ratios give you the improvement ratio which can be converted to a percentage improvement.

Amdahl's Law computations can also be done without drawing time lines. The most reliable way of doing this is a tabular computation. The computations are identical to the time line computations.

Amdahl's Law

Amdahl's Law

An Example

Before Time Line


After Time Line

Amdahl's Law — Time Lines

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?

Before the Change

To solve this, you can draw time lines representing the before and after execution times, broken down into components. The units that you use in your time lines won't affect improvement ratios or percentages as long as you use the same units for both time lines. 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 time unit.

Here is the before time line.

Others Memory Branches
50 30 20

After the Change

In the after time line, the "Others" part is unchanged. The "Memory" part is divided by a factor of 1.5 (computed as 1 + 50/100) and the "Branches" part is divided by a factor of 2 (computed as 1 + 100/100).

Here is the after time line.

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.

Amdahl's Law — Tabular

Tabular Calculations

Type Before % Improvement % Improvement Ratio After %
Others 50 0 1 + 0/100 = 1.0 50/1.0 = 50
Memory 30 50 1 + 50/100 = 1.5 30/1.5 = 20
Branches 20 100 1 + 100/100 = 2.0 20/2.0 = 10
Total 100 80