20MCA103 DFCA
PERFORMANCE
• Understanding how best to measure performance and
the
limitations of performance measurements is
important in
selecting a computer.
• If you were running a program on two different
desktop computers, the faster one is the desktop
computer that gets the job done first.
• If you were running a datacenter that had several
servers running jobs submitted by many users, the
faster computer was the one that completed the
most jobs during a day.
• As an individual computer user, you are interested in
reducing computer user, you are interested in
reducing
• response time—the time between the
start and completion of a task—also
referred to as execution time
• throughput or bandwidth—the total
amount of work done in a given time.
• Do the following changes to a computer system
increase throughput, decrease response time, or both?
• 1. Replacing the processor in a computer with a
faster version
• 2. Adding additional processors to a system that uses
multiple processors
• Decreasing response time almost always improves
throughput. Hence, in case
• 1, both response time and throughput are improved.
In case 2, no one task gets work done faster, so only
throughput increases.
• But it would reduce the waiting time in the queue.
Thus, in many real computer systems, changing
either execution time or throughput often affects the
other.
.
• To maximize performance, we want to
minimize response time or execution time
for some task.
• Thus, we can relate performance and
execution time for a computer X:
• Because performance and execution time
are reciprocals, increasing performance
requires decreasing execution time.
• To avoid the potential confusion between
the terms increasing and decreasing, we
usually
say “improve performance” or “improve
execution time” when we mean “increase
performance” and “decrease execution time.”
• Program execution time is measured in seconds per
.
program. However, time can be defined in different
ways, depending on what we count.
• The most straightforward definition of time is called
wall clock time, response time, or elapsed time.
These terms mean the total time to complete a task,
including disk accesses, memory accesses,
input/output (I/O) activities, operating system
overhead everything.
• Computers are often shared and a processor may
work on several programs simultaneously. In such
cases, the system may try to optimize throughput
rather than attempt to minimize the elapsed time for
one program.
• CPU execution time or simply CPU time, is the time
the CPU spends computing for this task and does not
include time spent waiting for I/O or running other
programs.
• CPU time can be further divided into the CPU time
spent in the program, called user CPU time, and the
• System performance is used to refer to elapsed
time on an unloaded system and CPU
performance to refer to user CPU time
• All computers are constructed using a clock that
determines when events take place in the
hardware. These discrete time intervals are
called clock cycles (or clock periods).
• Designers refer to the length of a clock period
both as the time for a complete clock cycle (e.g.,
250 picoseconds, or250 ps) and as the clock rate
(e.g., 4 gigahertz, or 4 GHz), which is the inverse
of the clock period
.
• CPU Performance and Its Factors.
• Users and designers often examine performance
using different metrics.
• CPU performance measure is CPUexecution time.
A simple formula relates the most basic metrics
(clock cycles and clock cycle time) to CPU time:
.
Instruction Performance
• The performance equations above did not include any reference to
the number of instructions needed for 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
CPU clock cycles =Instructions for a program x Average clock
cycles
per instruction
• The term clock cycles per instruction, which is the average
number of clock cycles each instruction takes to execute, is often
abbreviated as CPI.
• Since different instructions may take different amounts of time
depending on what they do, CPI is an average of all the
instructions executed in the program.
• Using the Performance Equation
• 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?
.
.
.
.