Title: Quantitative Performance Comparison
 1Quantitative Performance Comparison
  2Need for quantitative performance comparisons
- Modern CPUs utilize a number of architectural 
 advances
- Instruction sets of CPUs are different 
- RISC versus CISC 
- General purposes versus ASIC (Application 
 Specific Integrated Circuit) CPUs
- Different CPUs have different pipeline depths 
- The number  level of caches are different 
- The clock speed of CPUs are different 
- The number of ALUs vary impacting the type of 
 superscalar operations that CPUs can perform
- The aforementioned factors affect overall CPU 
 performance
- All of the above factors (including others) must 
 accounted to identify a good CPU
3Measuring Performance
- Performance is a relative quantitative metric 
 that is used to compare two CPUs
- Comparisons assume all other factors are 
 identical
- Performance is represented as a ratio 
- Given two computers ? and ? and a benchmark 
 program, then performance ratio is defined as
Performance Ratio  Benchmark Execution time on ?
Performance Ratio  Benchmark Execution time on ?
- Note that execution time is always measured as 
 the CPU time and not wall clock time.
- This is important on multi-tasking machines where 
 multiple programs may be using the CPU
4Example
- If computer A runs a program in 10 seconds and 
 computer B runs the same program in 15 seconds,
 how much faster is A than B?
- The performance ratio is
Execution time on A  15  1.5
Execution time on B  10  1.5
- Therefore computer A is 1.5 times faster than B
5Program Execution Time
- CPU Time for executing a program is determined 
 by
- The number of instructions to be executed 
- The number of Clock cycles Per Instruction (CPI) 
- Clock cycle time (seconds) or clock rate (Hertz) 
- Recollect that cycle time and rate are inversely 
 related
CPU Time  Instruction Count  CPI
CPU Time  Clock rate
The above formula can be rewritten as
CPU Time  Instruction Count  CPI  Cycle time
Note that changing any one of the above 
parameters impacts the CPU Time for executing a 
program 
 6Example
- Suppose we have two CPUs with the same 
 instruction set running the same program.
 Computer A has a clock cycle time of 250 ps and a
 CPI of 2.0. Computer B has a clock cycle time of
 500 ps and CPI of 1.2. Which computer is faster
 and by how much?
- Assume program as K instructions. 
- CPU Time for A  250  2  K  500K ps 
- CPU Time for B  500  1.2  K  600K ps 
- Therefore computer A is faster than computer B. 
Performance Ratio  600K  1.2
Performance Ratio  500K  1.2
Computer A is 1.2 times faster than Computer B 
 7More on CPI
- CPUs have a wide variety of instructions 
- The CPI for instructions vary 
- Some instructions require more cycles to complete 
- Some instructions require fewer cycles to 
 complete
- The overall average CPI of a program depends on 
 the mix of instructions used by the program
- If CPI changes the execution times of programs 
 can also change
- Consequently, two program with exactly the same 
 number of instructions (but instructions have
 different CPI) can have different execution times!
8Example
- The typical CPI for x86 architecture is shown 
 below
- Integer Instructions 1 CPI 
- Floating point instructions 2 CPI 
- Which program will run faster 
- Program P1 that uses 100 floating point 
 instructions
- Program P2 that uses 50 floating point and 75 
 integer instructions?
- Solution 
- Total cycles for P1  100  2  200 cycles 
- Total cycles for P2  (50  2)  (75  1)  175 
 cycles
- Therefore program P2 will run faster than program 
 P1 (even though P2 has more instructions)