Lesson 3 - Computing For Performance
Lesson 3 - Computing For Performance
Lesson 3 - Computing For Performance
Performance is important!
Comparisons:
Which machine is faster?
Figure 2
31
Common performance metrics
32
Computer A Computer B
Computer A Computer B
Answer: 8Ghz
Clock Cycles per Instruction (CPI)
37
Remember that overall CPI for a program will depend on both the
number of cycles for each instruction type and the frequency of each
instruction type in the program execution
Sample: Calculate CPI
44
You are on the design team for a new processor. The clock of the processor runs
at 200 MHz. The following table gives instruction frequencies for Benchmark
B, as well as how many cycles the instructions take, for the different classes of
instructions. For this problem, we assume that (unlike many of today's
computers) the processor only executes one instruction at a time.
Instruction Type Frequency Cycles
Loads & Stores 30% 6 cycles
Arithmetic Instructions 50% 4 cycles
All Others 20% 3 cycles
A compiler designer is trying to decide between two code sequences for a particular
computer. The hardware designers have supplied the following facts:
What do we know?
Clock Instruction
Instruction
cycles count There are 2
instructions
ADD 1 20
MUL 3 10
Example 4a: Calculating average CPI
53
Instruction Clock Instruction
cycles count
ADD 1 20
MUL 3 10
0
0
ACTIVITY
55
Clock rate (CR) = 8GHz = 8 x 109 Clock cycle (CC) = 1.5 x clock cycle
Hz Computer P
Understanding the Units
64
Example:
10s = 20cycle/ clock rate
Clock rate = 20/10 cycle per seconds = 2Hz