Measuring Computer Performance
Measuring Computer Performance
Performance
• Purchasing Perspective: given a collection of
machines (or upgrade options), which has the
• best performance ?
• least cost ?
• best performance / cost ?
BAD/Sud 1350
3 hours 132 178,200
Concorde mph
performance(x) = 1
execution_time(x)
performance(F) execution_time(S)
n= =
performance(S) execution_time(F)
Example of Response Time v. Throughput
• Time of Concorde vs. Boeing 747?
• Concord is 6.5 hours / 3 hours = 2.2 times faster
CPI:
Calculate: Execution Time / Clock cycle time
Instruction Count
Hardware counter in special register (PII,III,4)
CPU Performance
Calculating CPI Another Way
• First calculate CPI for each individual instruction
(add, sub, and, etc.)
• Next calculate frequency of each individual
instruction
• Finally multiply these two for each instruction
and add them up to get final CPI (the weighted
sum)
n Ij
CPI = å CPI j ´ Fj where Fj =
j =1 Instruction Count
Example (RISC processor)
Op Freqi CPIi Prod (% Time)
ALU 50% 1 .5 (23%)
Load 20% 5 1.0 (45%)
Store 10% 3 .3 (14%)
Branch 20% 2 .4 (18%)
2.2 (Where time spent)
Instruction Mix
How much faster would the machine be if a better data cache reduced the
average load time to 2 cycles?
Load à 20% x 2 cycles = .4
Total CPI 2.2 à 1.6
Relative performance is 2.2 / 1.6 = 1.38
How does this compare with reducing the branch instruction to 1 cycle?
Branch à 20% x 1 cycle = .2
Total CPI 2.2 à 2.0
Relative performance is 2.2 / 2.0 = 1.1
Amdahl's “Law”
• Speedup due to enhancement E:
• ExTime w/o E Performance w/ E
• Speedup(E) = -------------------- = ---------------------
• ExTime w/ E Performance w/o E
• How many year will it take until the program can be executed in
1 second.
Performance Example
• What would the clock rate of M1 have to be for them to have the
same execution time?
Marketing Metrics
• MIPS = Instruction Count /(Time * 10^6)
= Clock Rate / (CPI * 10^6)
– machines with different instruction sets ?
– programs with different instruction mixes ?
– dynamic frequency of instructions
– uncorrelated with performance