Recap 1 Amdahls Law Performance impact of optimizing

  • Slides: 8
Download presentation
Recap 1

Recap 1

Amdahl’s Law • Performance impact of optimizing part of a program: • Let an

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 = Old. Time x [(1 -f) x 1 + f x (1/s)] – Speedup = • s > 1. 0 for speedup, f <= 1. 0 as it is a fraction 2

Amdahl’s Law Old Time New Time =s 3

Amdahl’s Law Old Time New Time =s 3

Example 1 Which change is more effective on a certain Processor: speeding up 10

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% 4

Example SPEEDUPSQ = 1/((1 -0. 2) + (0. 2/10)) = 1. 22, or 22%

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% 5

Amdahl’s Law of Diminishing Returns: The Performance Enhancement Possible Is Limited By the Amount

Amdahl’s Law of Diminishing Returns: The Performance Enhancement Possible Is Limited By the Amount That the Improved Feature Is Used. 6

Example • A server spends 50% of CPU time on I/O and 50% on

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? 7

Multi-Core (parallelism) and Amdah’s law • Suppose a program takes 1 unit of time

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) 1 -s New Execution = Time P + s • 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? New Execution Time = . 8 T 4 + . 2 T = 0. 4 T Speedup =1 T/0. 4 T = 2. 5 • What is the maximum speedup from parallelization? 5 10/23/2021 Multi-Core and Thread-level Parallelism 8