80 likes | 283 Views
Recap. Amdahl’s Law. Performance impact of optimizing part of a program: Let an optimization speedup f fraction of time by a factor of s : New Time = OldTime x [(1-f) x 1 + f x (1/s)] Speedup = s > 1.0 for speedup, f <= 1.0 as it is a fraction. Amdahl’s Law. New Time. Old Time. = s.
E N D
Amdahl’s Law • Performance impact of optimizing part of a program: • Let an optimization speedup f fraction of time by a factor of s: • New Time = OldTime x [(1-f) x 1 + f x (1/s)] • Speedup = • s > 1.0 for speedup, f <= 1.0 as it is a fraction
Amdahl’s Law New Time Old Time = s
Example 1 Which change is more effective on a certain Processor: speeding up 10-fold the floating point square root operation only, which takes up 20% of execution time, or speeding up 2-fold all floating point operations, which take up 50% of total execution time? (Assume that the cost of accomplishing either change is the same, and the two changes are mutually exclusive.) • SPEEDUPSQ = 1/((1-0.2) + (0.2/10)) = 1.22, or 22% • SPEEDUPFP = 1/((1-0.5) + (0.5/2)) = 1.33, or 33% Improving all FP operations is more effective
Example • SPEEDUPSQ = 1/((1-0.2) + (0.2/10)) = 1.22, or 22% • SPEEDUPFP = 1/((1-0.5) + (0.5/2)) = 1.33, or 33% Improving all FP operations is more effective
Amdahl’s Law Law of Diminishing Returns:The Performance Enhancement Possible Is Limited By the Amount That the Improved Feature Is Used.
Example • A server spends 50% of CPU time on I/O and 50% on computation. What is the speedup if we replace the CPU with one that is 8 times faster?
Multi-Core (parallelism) and Amdah’s law • Suppose a program takes 1 unit of time to execute serially • A fraction of the program, s, is inherently serial (unparallelizable) • For example, consider a program that, when executing on one core processor, spends 20% of its time in a non-parallelizable region. How much faster will this program run on a 4-processor system? • What is the maximum speedup from parallelization? 5 Speedup =1T/0.4T = 2.5