What is Amdahl's law?

Amdahl's law is primarily used in computer architecture. It is used in parallel computing to make predictions regarding the theoretical speedup when multiple processors are used.

We define Amdahl's law as follows:

The formula that gives the theoretical speedup in the latency of execution of a task. This speedup is calculated for a fixed workload in accordance with the resources.

We can also define it as:

The overall performance improvement that is obtained by optimizing a part of the system. However, this improvement is limited by the fraction of time that the improved part is actually used.

Formula

The formula for Amdahl's law is:

Where:

  • pp is the ratio of the parallelizable code over the total execution time.

  • nn is the number of processors or the part of the task that speeds up due to the improved system resources.

Example

We have 44 processors and only 10%10\% of the code is parallelizable. Find the speed up.

Solution

Converting the value of pp into a fraction, 10%=10/100=0.110\% = 10/100 = 0.1

Replacing the values in the equation, we get:

When we solve this equation, we get:

This formula gives us:

We ignore the whole part and focus on the decimal part, which gives us optimization. Thus, the speedup will be 8.1%8.1\%.

Drawbacks

Amdahl's law has a few drawbacks. These are as follows:

  • Scaling falls off when the number of processors increases. This is due to synchronization barriers (locks) and memory collisions.

  • It isn't easy to compute the value of pp. This is because the serializable part occurs not only in code but also in the kernel and the hardware. Secondly, profilingA method used for understanding the relative complexity of different parts of concern for an architecture. is an essential part of this too.

  • Consistency of the private data cache of the multiprocessor systems is also to be considered.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved