Amdahls Law Examples bullet Floating point instructions impr
Solution
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?
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
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 states that the maximum speedup possible in parallelizing an algorithm is limited by the sequential portion of the code. Given an algorithm which is P% parallel, Amdahl’s law states that: MaximumSpeedup=1/(1- (P/100)). For example if 80% of a program is parallel, then the maximum speedup is 1/(1-0.8)=1/.2=5 times. If the program in question took 10 seconds to run serially, the best we could hope for in a parallel execution would be for it to take 2 seconds (10/5=2). This is because the serial 20% of the program cannot be sped up and it takes .2 x 10 seconds = 2 seconds even if the rest of the code is run perfectly in parallel on an infinite number of processors so it takes 0 seconds to execute
