Monday, June 6, 2011

Amhdal's Law Example

Okie, this is another famous topic in Computer Architecture subject but when you search the web, you can't find any good examples/contents with it.

First is the Amhdal's Law given equation:

Amhdal's Law basically is a qualitative measures on how much the new performance improvement can bring impact towards a system and how often the improvement had to be in use. 

The Amhdal's Law can be re-written to provides definition to speedup as in the following Amhdal's Speedup Equation


So we take a few questions that are related to Amhdal's Law.

(1)
If in the 2000, computer executes a program in 200 ms, the computer made in 2010 executes the same program in 150 ms, what is the speedup the computer manufacturer had achieved in the 10 years gap?

Solution:
See the Amhdal's Speedup equation

Speedup = Execution Time  (old)/Execution Time (new)
Speedup=200ms/150ms =1.33

(2)
Supposedly a computer spends 90% of time handling a particular type of computations when running a program, and manufacturer make improvisation that improves its performances on that type of particular type of computations by factor of 10. 

If program originally took 100 secs to execute, what will be the new execution time after changes?

Solution: 
Direct application of Amhdal's Law

Execution Time(old)=100
Frac(Used)=0.9
Frac(Unused)=0.1
Speedup(Used)=10

Apply the coefficient in Amhdal's Law and it will gives Execution Time(new) ~ 19

(3)
Which improvement in following cases gives a greater reduction in execution time:
(i) One that is used 20% of the time but improves performances by factor of 2 when used 
(ii) One that is used 70% of the time but improves performances by factor of 1.3 when used

Solution:
Apply Amhdal's Law

(i) Execution Time = Execution Time(old) X [ 0.8 +0.2/2 ] ~ 94% of Execution Time(old)
(ii) Execution Time = Execution Time(old)X [0.3+0.7/1.3] ~ 84% of Execution Time(old)

Case (ii) would offer better performances

No comments:

Another random post to read ? Come !

Related Posts with Thumbnails