Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parameters that affect it How to improve it and by how much

Similar presentations


Presentation on theme: "Parameters that affect it How to improve it and by how much"— Presentation transcript:

1 Parameters that affect it How to improve it and by how much
Performance Parameters that affect it How to improve it and by how much

2 Performance Response time/Execution time/Turn-around time/Latency/Wall-clock time/Elapsed time Time between the start and completion of a task. Users are normally interested in reducing this parameter. Includes CPU execution time for this task. Time spent waiting for I/O. Time spent waiting for CPU (in multi-programming systems) Time due to OS overhead.

3 Increase performance implies decrease execution time
Throughput Total amount of work done in a given time. A system administrator would like to increase the throughput. Increase performance implies increase throughput, decrease execution time

4 Performance vs Execution time
Performance (P) = 1/ tE If X is ‘n’ times faster than Y, it implies: Px/Py = n = tEy/tEx i.e. Y times takes ‘n’ times longer than X.

5 Example 1 If a machine A runs a program in 10 seconds and machine B runs the same program in 15 seconds, how much faster is A than B? n = PA/PB = tB/tA = 15/10 = 1.5 A is 1.5 times faster than B

6 CPU execution time/CPU time
Components of the execution time of a program: CPU execution time User CPU time System CPU time I/O time Time spent running other programs

7 System performance refers to Response time.
CPU performance refers to CPU execution time.

8 CPU Performance equation
CPU time = CPU clock cycles * cycle time = CPU clock cycles / clock rate CPU clock cycles = IC * CPI IC: instruction count (number of instructions per program) CPI: average cycles per instruction CPU time = IC * CPI * cycle time seconds instructions clock cycles seconds program program instruction clock cycle CPU clock cycles = Σi (CPIi * ICi) ICi : count of instructions of class i CPIi : cycles that takes to execute instructions of class i = * *

9 Example 2 Computer A has a 400 MHz clock and runs a program in 10 seconds. Computer B has a 800 MHz clock and runs the same program in 6 seconds. The increase in the clock rate of B implies an increase in the number of clock cycles required by B. Determine by how much the number of clock cycles in computer B has increased to allow for the higher clock rate. CPU time = CPU clock cycles * cycle time = CPU clock cycles / clock rate 10 = CPU clock cycles for A * 1/400 MHz = CPU clock cycles for B * 1/800 MHz CPU clock cycles for B = 1/400 * = 1.2 CPU clock cycles for A /800 * 10

10 Example 3 Given a machine M1 with a clock rate 2.7GHz, how long will a program P1 take to run if there are 4,298 instructions and each instruction takes an average of 2.9 cycles. seconds = instructions * clock cycles * seconds program program instruction clock cycle = x x 1/(2.7 x 109) CPU time = 4.26 x 10-6 seconds

11 CPU time = IC * CPI * cycle time
Example 4 Given P1 and M1 from previous problem, what is the relative performance of M1 with respect to a machine M2 having clock rate 3.1 GHz running P1, where each instruction of P1 on M2 requires 3.2 cycles instead of 2.9 cycles? CPU time = IC * CPI * cycle time Perf of M1 / Perf of M2 = (IC2 * CP2 /Clock rate2) (IC1 * CPI1 /Clock rate1) = (CPI2 * Clock rate1) (CPI1 * Clock rate2) = (3.2 * 2.7GHz) / (2.9 * 3.1GHz) = M1 is 1.04 times faster than M2.

12 Example 5 Given a machine M1 with clock rate 2.9 GHz, how long will a program P1 take to run that has 5,728 instructions and the following instruction mix and CPI? Instruction Type % Incidence CPI A | | 9 B | | 10 C | | 13 D | | 7 E | rem | 5

13 Example 5 Average CPI * Instruction Count of P1
Exec. Time of P1 on M1 = _______________________________________ Clock Rate of M1 CPU Clock cycles = (19*9+10*10+38*13+14*7+19*5) = 958 CPI = CPU Clock cycles/ Number of instructions = 958/100 = 9.58 9.58 * 5,728 Exec. Time of P1 on M1 = ______________ 2.9 * 10^9 Exec. Time of P1 on M1 = * 10-5 seconds

14 Which code sequence executes the most instructions?
Example 6 Comparing two compiler code segments Which code sequence executes the most instructions? Which will be faster? Instruction class i CPIi for instruction class i A 1 B 2 C 3 Code sequence Instruction counts (ICi) for instruction class A B C 1 2 4

15 Instruction count S1 : = 5 S2 : = 6 S1 executes fewer instructions than S2 To determine CPI CPU clock cycles = Σi (CPIi * ICi) S1 : CPU clock cycles = (2 x 1) + (1 x 2) + (2 x 3) = 10 cycles S2 : CPU clock cycles = (4 x 1) + (1 x 2) + (1 x 3) = = 9 cycles S2 requires fewer clock cycles than S1. b. CPI = CPU clock cycles S1 : CPI = 10/5 = 2 S2 : CPI = 9/6 = 1.5

16 Scope of Performance Sources
CPU time = IC * CPI * Cycle time Program Compiler ISA Organization Hardware

17 Evaluating performance
Ideal situation: known programs (workload) Benchmarks Real programs Synthetic benchmarks Risk: adjust design to benchmark requirements

18 Relative performance Total time: Σ exec timei
Arithmetic mean: AM = 1/n * Σ exec timei Weighted mean: WM = Σ wi * exec timei Geometric mean: GM = (Π exec time ratioi)1/n

19 Arithmetic Mean Program System A Execution Time System B Execution Time System C Execution Time V 50 100 500 W 200 400 600 X 250 Y 800 Z 5000 4100 3500 Average

20 Weighted Arithmetic Mean
Program Execution Frequency System A Execution Time System C Execution Time V 50% 50 500 W 30% 200 600 X 10% 250 Y 5% 400 800 Z 5000 3500 Weighted Average seconds seconds

21 Weighted Arithmetic Mean
Program Execution Frequency System A Execution Time Execution Frequency (original) V 25% 50 50% W 5% 200 30% X 10% 250 Y 400 Z 55% 5000 Weighted Average seconds 380 seconds

22 System B execution time System C execution time
Geometric Mean Program System A Execution Time Normalized to B System B execution time System C execution time V 50 100 1 500 0.2 W 200 400 600 0.667 X 250 Y 800 Z 5000 4100 3500 1.714 Geometric Mean 0.6898 2 0.82 1.6733

23 MIPS/MFLOPS MIPS = Instruction Count Execution Time x 106

24 Amdahl’s law The performance improvement that can be obtained from using a faster mode of execution is limited by the fraction of time that the faster mode can be used.

25 Amdahl’s law Overall Speedup = PEnhanced/PUnenhanced
= tUnenhanced/tEnhanced Depends on two factors: f – fraction of execution time that can be enhanced. s – speedup obtained for the fraction

26 Amdahl’s equation Overall Speedup =

27 Example 7 Let’s say that your processes spend 70% of their time running in the CPU and 30% waiting for service from the disk. You have the option to upgrade to a CPU that is 50% faster than your current CPU or to a set of disk drives that promise to be two and a half times faster than your current drives. Which upgrade would you choose?

28 CPU upgrade : f = 0.7 s = 1.5 Overall speedup = Disk drive upgrade : f = 0.3 s = 2.5 Overall speedup = CPU upgrade cost = $10,000 Disk drives upgrade cost = $7,000 and if cost is a concern, which would you choose? 1% of CPU upgrade => $10000/30 = $333 1% of disk drive upgrade => $7000/22 = $318


Download ppt "Parameters that affect it How to improve it and by how much"

Similar presentations


Ads by Google