Lably
Skip to content

Amdahl's law

Formula in computer architecture

  • 6 min read
  • 3 chapters

Related on Lably

Through Diminishing returns

The law can be stated as:

the overall performance improvement gained by optimizing a single part of a system is limited by the fraction of time that the improved part is actually used.

It is named after computer scientist Gene Amdahl, and was presented at the American Federation of Information Processing Societies (AFIPS) Spring Joint Computer Conference in 1967.

Amdahl's law is often used in parallel computing to predict the theoretical speedup when using multiple processors.

Definition

In the context of Amdahl's law, speedup can be defined as:

Speedup=Performance for the entire task when enhancements are appliedPerformance for the same task without those enhancements

or

Speedup=Execution time for the entire task without enhancementsExecution time for the same task when enhancements are applied

Amdahl's law can be formulated in the following way:

Speedupoverall=1(1−timeoptimized)+timeoptimizedspeedupoptimized

where

  • Speedupoverall represents the total speedup of a program
  • Timeoptimized represents the proportion of time spent on the portion of the code where improvements are made
  • Speedupoptimized represents the extent of the improvement

The Speedupoverall is frequently much lower than one might expect. For instance, if a programmer enhances a part of the code that represents 10% of the total execution time (i.e. Timeoptimized of 0.10) and achieves a Speedupoptimized of 10,000, then Speedupoverall becomes 1.11 which means only 11% improvement in total speedup of the program. So, despite a massive improvement in one section, the overall benefit is quite small. In another example, if the programmer optimizes a section that accounts for 99% of the execution time (i.e. Timeoptimized of 0.99) with a speedup factor of 100 (i.e. Speedupoptimizedof 100), the Speedupoverall only reaches 50. This indicates that half of the potential performance gain (Speedupoverall will reach 100 if 100% of the execution time is covered) is lost due to the remaining 1% of execution time that was not improved.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication