Lecture 3 - CH 01
Lecture 3 - CH 01
Lecture 3 - CH 01
Edition
The Hardware/Software Interface
Chapter 1
Computer Abstractions
and Technology
§1.6 Performance
Defining Performance
◼ Which airplane has the best performance?
Clock (cycles)
Data transfer
and computation
Update state
B = I 600ps = 1.2
CPU Time
…by this much
CPU Time I 500ps
A
Chapter 1 — Computer Abstractions and Technology — 10
CPI in More Detail
◼ If different instruction classes take different
numbers of cycles
n
Clock Cycles = (CPIi Instruction Counti )
i=1
Relative frequency
Class A B C
CPI for class 1 2 3
IC in sequence 1 2 1 2
IC in sequence 2 4 1 1
◼ Sequence 1: IC = 5 ◼ Sequence 2: IC = 6
◼ Clock Cycles ◼ Clock Cycles
= 2×1 + 1×2 + 2×3 = 4×1 + 1×2 + 1×3
= 10 =9
◼ Avg. CPI = 10/5 = 2.0 ◼ Avg. CPI = 9/6 = 1.5
Chapter 1 — Computer Abstractions and Technology — 13
More Examples
Consider three different processors P1, P2, and P3 executing
the same instruction set. P1 has a 3 GHz clock rate and a
CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3
has a 4.0 GHz clock rate and has a CPI of 2.2.
1) Which processor has the highest performance expressed in
instructions per second?
3) A new compiler is developed that uses only 6.0E8 instructions and has
an average CPI of 1.1. What is the speedup of using this new compiler
versus using compiler A or B on the original processor?
◼ Performance depends on
◼ Algorithm: affects IC, possibly CPI
◼ Programming language: affects IC, CPI
◼ Compiler: affects IC, CPI
◼ Instruction set architecture: affects IC, CPI, Tc