Вы находитесь на странице: 1из 14

Lecture 15

Performance
Read and understand PH2 Chapter 2 from first to last page!

15.1

How Do You Measure The Performance of a Computer System?


15.2

How Do You Define The Performance of a Computer System?


Its clock rate? Count the frame rate when you play Quake? Count the time it takes to multiply large matrices? Count how many instructions per second it can execute?

. . .
15.3

Two Helpful Metrics


Throughput: total amount of work done in a given time. Execution Time (or Response Time): total time elapsed between the moment a task is started and finished.

arrival rate

service time
15.4

Improving Throughput

'
Decrease service time: ' <

Share the workload

15.5

How We Define Performance


1 Performance = Execution Time
The faster a computer executes a program, the better the computer is. Have two machines, X and Y, the fastest is the one that gives the shortest execution time for the program. 1 1 PX = > PY = ETY > ETX ETX ETY Choose Y to be the reference machine: PX ETY Relative Performance X = = =n PY ETX

15.6

Measuring Execution Time


Two alternatives:
Use something like the Unix time command (wall-clock, chronometer, etc). Count the number of CPU clock cycles:

ET = clock cycles clock period


Ticket to performance improvement?
15.7

1 clock period = clock rate

clock cycles ET = clock rate


Question: Have a computer, what is the simplest hardware modification I can make to improve its performance?
15.8

clock cycles ET = clock rate


clock cycles clock cycles = number of instructions average instruction
Question: If I want to make the same computer look better (performance), what can I do? Software tweaking: reduce the number of instructions that is executed by the program (better compiler; reduce the size of the program).
15.9

clock cycles average = CPI instruction


Different instructions may take a different number of clock cycles to execute. The CPI is a average over all the instructions in a program. One can also reduce the CPI to improve performance. Say we have two machines X and Y which implement the same instruction set architecture (ISA). The best implementation of the ISA is the one with the lowest CPI.
15.10

Practical Considerations
How do we count the number of instructions executed in a program? Is the CPI independent of the program we use? How do we figure out the CPI?
Identify the i different classes of instructions used in the program and count Ci , the number of instructions from each class in the program. Each class groups instructions with the same clock count CPIi (integer arithmetic, memory access, etc).

clock cycles =

n i =1

(CPI i Ci )
15.11

Fallacies
1) Higher clock rate alone make a faster computer. 2) The fact that a computer runs a certain program faster implies it is in general a faster computer.

15.12

Fallacies
3) MIPS is a performance metric:
MIPS = instruction count ET 106

Instruction rate wont tell you anything about what each instruction can do. What if all the instructions used to determine the MIPS rating are those that require the least CPI? MIPS can vary inversely with performance (see PH2 p. 78)
15.13

Fallacies
4) Improving one aspect of the machine will increase the performance of the machine by an amount proportional to the size of the improvement.
Improvable ET ET ' = + Unimprovable ET improvement
Amdahls Law (1967) or Law of Diminishing Returns
15.14

Вам также может понравиться