4 Perfrmance
4 Perfrmance
seconds
how many times faster is machine A?
25
20 = 1.25
Basic Measurement
Comparing Machines
Metrics
Metrics
Execution time
Throughput
CPU time
Benchmarks
clock period
2nd instruction
3rd instruction
1st instruction
4th
5th
6th
...
time
time
Compiler X X
X
Instr. Set Arch. X
X
Organization X
Technology X
Example 2:
CPU clock rate is 500 MHz
Program takes 45 million cycles to execute
What’s the CPU time
instructions do better.
MFLOPS : millions of floating point operations per second
MFLOPS = floating point operations / (execution time x 106)
For example, a program that executes 4 million fp. instructions in 5
What would the clock rate of M1 have to be for them to have the
same execution time?
ExTime old
Performance new Speedup = =
ExTime new
Performance old
Suppose that an enhancement
accelerates a fraction
enhanced of the task by a
Fraction Fractionenhanced
factor
ExTimenew = ExTime
Speedup x (1 - Fractionenhanced) +
oldenhanced
Speedupenhanced
ExTimeold 1
Speedup =
ExTimenew Fractionenhanced
= (1 - Fractionenhanced ) +
Speedupenhanced
Example of Amdahl’s Law
Floating point instructions are improved to run twice as fast,
but only 10% of the time was spent on these instructions
originally. How much faster is the new machine?
Speedup = ExTimeold 1
ExTimenew Fractionenhanced
= (1 - Fractionenhanced ) +
Speedupenhanced
1
Speedup = 1.053
= (1 - 0.1) + 0.1/2
The new machine is 1.053 times as fast, or 5.3% faster.
How much faster would the new machine be if floating
point instructions become 100 times faster?
1
Speedup = 1.109
= (1 - 0.1) + 0.1/100
Another Example
Execution Time After Improvement =
Execution time unaffected + (Execution time affected/ improvement)
Example:
program runs for 100 seconds on a machine with multiply
responsible for 80 seconds of this time. If the multiply unit is made 4 times
faster. Then what is the overall speedup.
80 seconds
50 seconds = + (100 – 80 seconds)
n
80 seconds
n= = 2.67
30 seconds
Summary of Performance Evaluation
Good benchmarks, such as the SPEC benchmarks, can
provide an accurate method for evaluating and
comparing computer performance.
MIPS and MFLOPS are easy to use, but inaccurate
indicators of performance.
Amdahl’s law provides an efficient method for
determining speedup due to an enhancement.
Make the common case fast!