The
most important measure of the performance of a computer is its speed of
execution. The speed with which a
computer executes programs is affected by the design of its hardware and its
machine language instructions. The time
required for executing a computer program is affected mainly by the speed of
the processor, the main memory and the hard disk.
Generally, performance describes how quickly a given system can execute a program (called execution time). Systems that execute programs in less time are said to have high performance. In order to find out the performance of a computer, computer architects have come up with a variety of metrics. Some of them are discussed here:
Million
Instructions Per Second (MIPS):
An early measure of computer
performance was the rate at which a given machine executed instructions. This is calculated by dividing the number of
instructions executed in running a program by the time required to run the
program and typically expressed in millions of instructions per second (MIPS).
CPI/IPC:
Another
metric used to describe computer performance is the number of clock cycles
required to execute each instruction, known as cycles per instruction,
or CPI. The CPI of a given program on a
given system is calculated by dividing the number of clock cycles required to
execute the program by the number of instructions executed in running the
program. For systems that can execute
more than one instruction per cycle, the number of instructions executed per cycle,
or IPC, is often used instead of CPI.
IPC is calculated by dividing the number of instructions executed in
running a program by the number of clock cycles required to execute the
program.
Suppose 100-instruction loop is executed 42 times, the total number of instructions executed is 100 x 42 = 4200. It takes 16,000 cycles to execute the program, so the CPI is 16,000/4200 = 3.81. That means 3.81 (around 4 cycles) are required to execute a single machine instruction. To compute the IPC, we divide 4200 instructions by 16,000 cycles, getting an IPC of 0.26.
Processor
Clock:
Processor
circuits are controlled by a timing signal called a clock. The clock defines regular time intervals,
called clock cycles. To execute a
machine instruction, the processor divides the action to be performed into a
sequence of basic steps (e.g., fetch, decode etc.), such that each step can be
completed in one clock cycle. The length
P of one clock cycle is an important parameter that affects processor
performance.
Clock Rate:
The
inverse of P (1/P) is the clock rate (R), which is
measured in cycles per second.
Processors used in today’s personal computers and workstations have
clock rates that range from a few hundred million to over a billion cycles per
second. In standard electrical
engineering terminology, the term “cycles per second” is called hertz
(Hz). The term “million” is denoted by
the prefix Mega (M), and “billion” is denoted by the prefix Giga (G).
Basic Performance Equation:
Let
T be the processor time required to execute a program that has been prepared in
some high-level language. The elapsed
time (T) is totally depend on all units in a computer system, which includes
processor, memory and I/O devices). The
compiler generates a machine language object program that corresponds to the
source program.
Assume that the complete execution of the program requires the execution of N machine language instructions. The number N is the actual number of instruction executions, and is not necessarily equal to the number of machine instructions in the object program. Some instructions may be executed more than once, which is the case for instructions inside a program loop. Others may not be executed at all, depending on the input data used.
Suppose that the average number of basic steps needed to execute one machine instructions is S, where each basic step is completed in one clock cycle. If the clock rate is R cycles per second, the program execution time is given by:
This
is often referred to as the basic performance equation. To achieve high performance, the computer
designer must seek ways to reduce the value of T, which means reducing N and S,
and increasing R.
The
value of N is reduced if the source program is compiled into fewer machine instructions. The value of S is reduced if instructions have
a smaller number of basic steps to perform or if the execution of instructions
is overlapped. Using a higher-frequency
clock increases the value of R, which means that the time required to complete
a basic execution step is reduced.