Assessing and Understanding Performance
Assessing and Understanding Performance
Bo Cheng
Passengers
101
470 132 146
Range (mi)
630
4150 4000 8720
Speed (mph)
598
610 1350 544
Measuring Performance
a useful number, but often not good for comparison purposes Doesn't count I/O or time spent running other programs can be broken up into system CPU time, and user CPU time CPU time = user CPU time +system CPU time time spent executing the lines of code that are "in" our program
Response time: the time between the start and the completion of a task (in time units) Throughput: the total amount of work done in a given time (in number of tasks per unit of time)
Performance
Problem: 1 Performancex Machine A runs a execution _ timex program in 10 sec. Performancex execution _ timey n Machine B runs the Performancey execution _ timex same program in 15 sec. How much faster is A than B ?
15 1.5 10
Example
Measurement
1 msec (ms) 1 usec (us) 1 nsec (ns) 1 psec (ps) 1 fsec (fs)
=> => => =>
10 nsec clock cycle 1 nsec clock cycle 500 psec clock cycle 200 psec clock cycle
100 MHz clock rate 1 GHz clock rate 2 GHz clock rate 5 GHz clock rate
MHz
http://www.webopedia.com/TERM/M/MHz.html
One MHz represents one million cycles per second. The speed of microprocessors, called the clock speed, is measured in megahertz.
For example, a microprocessor that runs at 200 MHz executes 200 million cycles per second.
The actual time the CPU spends computing for a specific task This time accounts for the time CPU is computing the given program, including operating system routines executed on the programs behave, and it does not include the time waiting for I/O and running other programs. Performance of processor/memory = 1 / CPU_time
N E N *T R
E = CPU Execution time for a program N = Number of CPU clock cycles for a program T = clock cycle Time R = clock Rate
Example
Job
N 10 4
10 seconds
Job
6 seconds
1.2 * N 6 R
Computer A 4 GHz
R = 8 GHz
Computer B X GHz
N = Number of CPU clock cycles for a program I = total Instructions for a program C = CPI
N I *C
CPI Possibly X X X
Clock Rate
CPI
2 1.2
CPU A I * 2 * 250 500I CPUB I * 1.2 * 500 600I PerformanceA CPUB 600I 1.2 PerformanceB CPU A 500I
Computing CPI
Done by looking at the different types of instructions and using their individual cycle counts n
Ci: The count of the number of instructions of class i executed CPIi: The average number of cycles per instruction for that instruction class l n: is the number of instruction classes
Example
CPI for this instruction class Code Sequence CPI for this instruction class
CPI
A 1
B 2
C 3
1 2
A 2 4
B 1 1
C 2 1
CC1 (2 * 1) (1 * 2) (2 * 3) 10 10 CPI1 2 5
Workload
A set of programs used for evaluating a computer or a system Benchmarks: programs specifically chosen to measure performance. SPEC 2000 benchmarks (12 integer, 14 floatingpoint programs). Performance results given by benchmarks may not be correct if the system (or the compiler of the system) is optimized for the benchmarks
Benchmark
Programs specifically chosen to measure performance Best determined by running a real application
use programs typical of expected workload e.g., compilers/editors, scientific applications, graphics...
nice for architects and designers companies have agreed on a set of real program and inputs
Small benchmarks
Simplest Approach
Computer B 10 100
Total (sec)
1001
110
Evaluating Performance
CPU Performance
Desktop
SPEC CPU benchmark to measure CPU performance and response time focusing on a specific task: DVD playback or graphic performance of games depend on the nature of intended application Throughput
Server
requirements on response time to individual events: database query and web page request SPECweb99
Embedded Computing
EEMBC
Amdahls Law
Execution Time After Improvement = ( Execution Time Affected/ Amount of Improvement) + Execution Time Unaffected Principle: Make the common case fast
CPI
1 2
Code from
Compiler 1 Compiler 2
http://www.faculty.uaf.edu/ffdr/EE443/Handouts/Set5_Sp05_3pp.pdf
http://www.faculty.uaf.edu/ffdr/EE443/Handouts/Set5_Sp05_3pp.pdf
MIPS specifies the instruction execution rate but does not take into account the capabilities of the instructions.
We cannot compare computers with different instruction sets using MIPS, since the instruction counts will certainly differ.