Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to Computer Org. Assessing Performance. What Is Performance? What do we mean when we talk about the “performance” of a CPU?

Similar presentations


Presentation on theme: "Intro to Computer Org. Assessing Performance. What Is Performance? What do we mean when we talk about the “performance” of a CPU?"— Presentation transcript:

1 Intro to Computer Org. Assessing Performance

2 What Is Performance? What do we mean when we talk about the “performance” of a CPU?

3 What Is Performance? “Computer performance is characterized by the amount of useful work accomplished by a computer system compared to the time and resources used.” -Wikipedia article

4 What Is Performance? “Computer performance is characterized by the amount of useful work accomplished by a computer system compared to the time and resources used.” -Wikipedia article

5 What Is Performance? What do we mean when we talk about the “performance” of a CPU? Perhaps: The time it takes to run program A? The time it takes to run program B? The time it takes to run program C? A mix of the above?

6 What Is Performance? What do we mean when we talk about the “performance” of a CPU? Perhaps: The time it takes to run A, B, and C individually, with no interference? The time it takes to run A, B, and C simultaneously, interfering with each other?

7 What Is Performance? Our first and most intuitive measure of “performance” is the execution time of a single program, without interference. The time between the start and end of the program, or perhaps an important part of the program. Consider boot times of different operating systems and our perceptions of them.

8 Execution Time To be more mathematical, Performance = 1 / Execution Time. We consider something to perform better if its execution time is smaller. This easily extends to Performance X > Performance Y if Execution Time Y > Execution Time X. …and other such equations that are left as an exercise for the reader.

9 Execution Time Things start getting more tricky when we compare performance across multiple programs. Benchmarks tend to do this.

10 Comparing Execution Times Consider the case above. Can we say, without any other input, which computer is better? P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

11 Comparing Execution Times Suppose that each program is run equally often, or has equal importance. Now we can say A is better than B. A takes 13 secs, B takes 14 secs. P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

12 Comparing Execution Times Suppose that each program 1 is run twice as often as the others. A is definitely still the better choice. P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

13 Comparing Execution Times Suppose that each program 2 is run twice as often as the others. B will be better than A! 18 secs for A vs. 16 secs for B. P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

14 Comparing Execution Times Suppose that each program 3 is run twice as often as the others. A and B will be evenly matched! 18 secs for A vs. 18 secs for B. P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

15 Comparing Execution Times The case where all have equal weight is called the arithmetic mean. (AM) When they have different weights, we call it the weighted AM. (WAM) P1 (s)P2 (s)P3 (s) Computer A355 Computer B824

16 A Different Perspective Consider the case above. Can we say, without any other input, which computer is better? P1 (s)P2 (s) Computer A32 Computer B43

17 A Different Perspective Suppose that each computer must run each program separately. Computer A is the clear winner, being faster on both programs. P1 (s)P2 (s) Computer A32 Computer B43

18 A Different Perspective Suppose that Computer B can run the two programs concurrently without interference, while Computer A cannot. P1 (s)P2 (s) Computer A32 Computer B43

19 A Different Perspective Computer A would take 3 + 2 = 5 secs. Computer B would take max(4, 3) secs. 5 secs > 4 secs, so B wins. P1 (s)P2 (s) Computer A32 Computer B43

20 CPU Performance Let us now examine a program’s CPU time, the time when the program is actually doing work. Keep in mind that modern OSes swap programs in and out constantly, meaning the actual elapsed time will be greater than the CPU time.

21 CPU Execution Time CPU execution time for a program = CPU clock cycles * Clock cycle time = CPU clock cycles / Clock rate CPU clock cycles – number of computational steps required Clock cycle time – amount of time required for a computational step

22 CPU Execution Time Breaking things down further, CPU clock cycles = Instruction count * Average clock cycles per instruction (CPI) Our single cycle datapath has a CPI of 1 – any instruction takes a single cycle. This is not always the case – other implementations may have different CPIs.

23 CPU Execution Time One thing that is important to note is an implementation’s CPI and its clock cycle time affect each other. It is possible to reduce the clock cycle time by making certain instructions take more cycles. Decrease in cycle time = increase in cycle count, here.

24 CPU Execution Time Final equation: CPU time = Instruction Count * CPI * Clock cycle time -or- CPU time = Instruction Count * CPI / Clock rate

25 CPU Execution Time See the book for example problems. Examples will be provided in-class, but not in these slides due to their mathematical nature.

26 Amdahl’s Law An improvement in part of a CPU can only affect that CPU’s performance in a limited way. To be precise, Execution time after = ((Execution time affected / speedup) + Execution time unaffected )

27 Amdahl’s Law Suppose we wished to speed up 80% of a program in such a way that it ran 4 times as quickly. Let us suppose it takes 100 secs to run.

28 Amdahl’s Law 25 secs = ((80 secs / n) + 20) 5 secs = 80 secs / n n = 80 / 5 = 16. To get a 4x speedup of the program, we’d have to speed up 80% of it 16x. A 5x overall speedup is impossible.

29 Amdahl’s Law An important consequence of Amdahl’s Law is to “make the common case fast.” The more often a part of the program runs, the more speeding it up (or slowing it down!) will affect the overall program.


Download ppt "Intro to Computer Org. Assessing Performance. What Is Performance? What do we mean when we talk about the “performance” of a CPU?"

Similar presentations


Ads by Google