Chapter 8 - CPU Performance
Chapter 8 - CPU Performance
1
OUTLINE
2
Defining Computer
performance
3
What is Performance?
Clock Frequency:
My computer runs at 500MHz, yours only at 300MHz, so my computer is
better than yours!
4
Example: Which Airplane is “best”?
Airplane Passengers Range (mi) Speed (mph)
Boeing 737-100 132 630 598
Boeing 747 470 4150 610
BAC/Sud Concorde 101 4000 1350
Douglas DC-8-50 146 8720 544 Which Airplane
performs better?
• How much faster is the Concorde than the 747?
– 2.213 times faster
• How much larger is the 747’s capacity than the Concorde?
– 4.65 larger
• It is roughly 4000 miles from Raleigh to Paris. What is the throughput of
the 747 in passengers/hr? The Concorde?
610 1350
470 = 71.675 passengers/hr 101 = 34.0875 passengers/hr
4000 4000
• What is the latency of the 747? The Concorde?
– 4000/610 = 6.56 hours ; 4000/1350 = 2.96 hours
5
Who is interested in Computer Performance?
6
What is PERFORMANCE?
7
What is performance? (cont…)
8
What Does Performance Mean?
Note:
• Response time - Elapsed time from request to response
• Throughput - Jobs, operations completed per unit time
9
Why is Performance Difficult to Measure?
10
Performance
Metrics
11
Performance Metric
• Let look at some of the ways in which the performance of computers is (or
has been) measured:
1. Clock rate
• The speed of a processor’s clock determines how fast individual
operations are carried out within the chip.
• Clock rate simply tells us how rapidly a device is clocked but
NOT how many operations are carried out at each clock pulse or
how much computation they perform.
• Clock rates have increased dramatically.
– The clock rate of the very first processors in the 1970s was
approximately 100 kHz (105 Hz).
– The clock rate of some modern processors is 4 GHz (4 x109 Hz).
Experimental devices have been clocked as rapidly as 500 GHz (5
x1011 Hz).
http://www.intel.com/pressroom/kits/quickreffam.htm 12
Performance Metric (cont…)
14
Computer Performance
➢ Response Time (latency)
✓ How long does it take for my job to run?
✓ How long does it take to execute a job?
✓ How long must I wait for the database query?
➢ Throughput
✓ How many jobs can the machine run at once?
✓ What is the average execution rate?
✓ How much work is getting done?
15
Why measure performance?
➢ Make intelligent choices
➢ See through the marketing hype
➢ Key to understanding underlying organizational motivation
16
Response Time and Throughput
• Response time
– How long it takes to do a task
• Throughput
– Total work done per unit time
• e.g., tasks/transactions/… per hour
17
Relative Performance
Performance X Performance Y
= Execution time Y Execution time X = n
18
Relative Performance
Performance X Performance Y
= Execution time Y Execution time X = n
19
Measuring Execution Time
• Elapsed time
– Total response time, including all aspects
• Processing, I/O, OS overhead, idle time
– Determines system performance
• CPU time
– Time spent processing a given job
– Comprises user CPU time and system CPU time
– Different programs are affected differently by CPU and system
performance
20
CPU Clocking
Clock period
Clock (cycles)
Data transfer
and computation
Update state
21
CPU Time
22
CPU Time Example
24
CPI Example
B = I 600ps = 1.2
CPU Time
CPU Time I 500ps …by this much
A
25
CPI in More Detail
n
Clock Cycles = (CPIi Instruction Counti )
i=1
Relative frequency
26
CPI Example
▪ Program 1: IC = 5 ◼ Program 2: IC = 6
◼ Clock Cycles ◼ Clock Cycles
= 2×1 + 1×2 + 2×3 = 4×1 + 1×2 + 1×3
= 10 =9
◼ Avg. CPI = 10/5 = 2.0 ◼ Avg. CPI = 9/6 = 1.5
27
Performance Summary
• Performance depends on
– Algorithm: affects IC, possibly CPI
– Programming language: affects IC, CPI
– Compiler: affects IC, CPI
– Instruction set architecture: affects IC, CPI, Tc
28
Amdahl’s law
29
• Amdahl’s Law implies that the overall performance
improvement is limited by the range of impact when an
optimization is applied. Consider the following equations:
• Improvement rate N = (original execution time) / (new execution
time)
• New execution time = time_unaffected + time_affected /
(Improvement Factor)
• Time = (instruction count) × CPI × CCT
30
• CPI = (execution_time x clock_rate)/instructions
31
Amdahl’s law
• If a program currently takes 100 seconds to execute and loads and stores
account for 20% of the execution times, how long will the program take if
loads and stores are made 30% faster?
• For this, you can use Amdahl's law or you can reason it out step by step.
Doing it step by step gives (1) Before the improvement loads take 20
seconds (2) If loads and stores are made 30 percent faster they will take
20/1.3 = 15.385 seconds, which corresponds to 4.615 seconds less. (3)
Thus, the final program will take 100 - 4.615 = 95.38
32
Amdahl’s law
Wikipedia
33
Amdahl’s law
Wikipedia
34
Amdahl’s law
Wikipedia
35
Amdahl’s law
Wikipedia
36
Amdahl’s law
Wikipedia
37
Amdahl’s law
Wikipedia
38
Amdahl’s law
Wikipedia
39
Amdahl’s law