Cpu Performance
Cpu Performance
Cpu Performance
Throughput
Also called bandwidth. Another measure of performance,
it is the number of tasks completed per unit time.
Example
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?
Answer
We know that A is n times as fast as B if
Clock cycle
Also called tick, clock tick, clock period, clock, or cycle.
The time for one clock period, usually of the processor
clock, which runs at a constant rate.
Clock period
The length of each clock cycle.
CPU Performance and Its Factors
CPU performance measure is CPU execution
time.
Example
Our favorite program runs in 10 seconds on computer A,
which has a 2 GHz clock. We are trying to help a computer
designer build a computer, B, which will run this program in
6 seconds. The designer has determined that a substantial
increase in the clock rate is possible, but this increase will
affect the rest of the CPU design, causing computer B to
require 1.2 times as many clock cycles as computer A for this
program. What clock rate should we tell the designer to
target?
Clock cycle computation of computer A is already shown
earlier.
CPU time for B can be found using this equation:
Instruction Performance
The performance equations above did not include any
reference to the number of instructions needed for the
program. However, since the compiler clearly
generated instructions to execute, and the computer
had to execute the instructions to run the program, the
execution time must depend on the number of
instructions in a program. One way to think about
execution time is that it equals the number of
instructions executed multiplied by the average time
per instruction. Therefore, the number of clock cycles
required for a program can be written as:
The term clock cycles per instruction, which is the
average number of clock cycles each instruction takes
to execute, is often abbreviated as CPI.
Example
Suppose we have two implementations of the same
instruction set architecture. Computer A has a clock cycle
time of 250 ps and a CPI of 2.0 for some program, and
computer B has a clock cycle time of 500 ps and a CPI of 1.2
for the same program. Which computer is faster for this
program and by how much?
Answer
Likewise, for B:
Clearly, computer A is faster. The amount faster is
given by the ratio of the execution times:
Example
A compiler designer is trying to decide between two code
sequences for a computer. The hardware designers have
supplied the following facts:
For a particular high-level language statement, the
compiler writer is considering two code sequences
that require the following instruction counts: