Lecture Ch4 Performance
Lecture Ch4 Performance
1
PerformanceX =
Execution timeX
Important point
Changing the cycle time often changes the number of cycles required for
various instructions (more later)
Performance Equation
To execute a given program, it will require …
o Some number of machine instructions
o Some number of clock cycles
o Some number of seconds
We can relate CPU clock cycles to instruction count
Program X X
Compiler X X
ISA X X X
Organization X X
Technology X
Using the Performance Equation
Suppose we have two implementations of the same ISA
For a given program
o Machine A has a clock cycle time of 250 ps and a CPI of 2.2
o Machine B has a clock cycle time of 500 ps and a CPI of 1.0
o Which machine is faster for this program, and by how much?
Solution:
o Both computers execute same count of instructions = I
o CPU execution time (A) = I × 2.2 × 250 ps = 550 × I ps
o CPU execution time (B) = I × 1.0 × 500 ps = 500 × I ps
550 × I
o Computer B is faster than A by a factor = = 1.1
500 × I
Determining the CPI
Different types of instructions have different CPI
Let CPIi = clocks per instruction for class i of instructions
Let Ci = instruction count for class i of instructions
n
n
∑ (CPI × C )i i