SlideShare a Scribd company logo
1 of 38
Performance
COE 301 Computer Organization
Dr. Aiman El-Maleh
College of Computer Sciences and Engineering
King Fahd University of Petroleum and Minerals
[Adapted from slides of Dr. M. Mudawar, COE 301, KFUPM]
Performance COE 301 – KFUPM slide 2
Outline
 Response Time and Throughput
 Performance and Execution Time
 Clock Cycles Per Instruction (CPI)
 MIPS as a Performance Measure
 Single- vs. Multi-cycle CPU Performance
 Amdahl’s Law
 Benchmarks
 Performance and Power
Performance COE 301 – KFUPM slide 3
 How can we make intelligent choices about computers?
 Why some computer hardware performs better at some
programs, but performs less at other programs?
 How do we measure the performance of a computer?
 What factors are hardware related? software related?
 How does machine’s instruction set affect performance?
 Understanding performance is key to understanding
underlying organizational motivation
What is Performance?
Performance COE 301 – KFUPM slide 4
Response Time and Throughput
 Response Time
 Time between start and completion of a task, as observed by end user
 Response Time = CPU Time + Waiting Time (I/O, OS scheduling, etc.)
 Throughput
 Number of tasks the machine can run in a given period of time
 Decreasing execution time improves throughput
 Example: using a faster version of a processor
 Less time to run a task  more tasks can be executed
 Increasing throughput can also improve response time
 Example: increasing number of processors in a multiprocessor
 More tasks can be executed in parallel
 Execution time of individual sequential tasks is not changed
 But less waiting time in scheduling queue reduces response time
Performance COE 301 – KFUPM slide 5
 For some program running on machine X
 X is n times faster than Y
Book’s Definition of Performance
Execution timeX
1
PerformanceX =
PerformanceY
PerformanceX
Execution timeX
Execution timeY
= n
=
Performance COE 301 – KFUPM slide 6
 Real Elapsed Time
 Counts everything:
 Waiting time, Input/output, disk access, OS scheduling, … etc.
 Useful number, but often not good for comparison purposes
 Our Focus: CPU Execution Time
 Time spent while executing the program instructions
 Doesn't count the waiting time for I/O or OS scheduling
 Can be measured in seconds, or
 Can be related to number of CPU clock cycles
What do we mean by Execution Time?
Performance COE 301 – KFUPM slide 7
 Clock cycle = Clock period = 1 / Clock rate
 Clock rate = Clock frequency = Cycles per second
 1 Hz = 1 cycle/sec 1 KHz = 103 cycles/sec
 1 MHz = 106 cycles/sec 1 GHz = 109 cycles/sec
 2 GHz clock has a cycle time = 1/(2×109) = 0.5 nanosecond (ns)
 We often use clock cycles to report CPU execution time
Clock Cycles
Cycle 1 Cycle 2 Cycle 3
CPU Execution Time = CPU cycles × cycle time
Clock rate
CPU cycles
=
Performance COE 301 – KFUPM slide 8
Improving Performance
 To improve performance, we need to
 Reduce number of clock cycles required by a program, or
 Reduce clock cycle time (increase the clock rate)
 Example:
 A program runs in 10 seconds on computer X with 2 GHz clock
 What is the number of CPU cycles on computer X ?
 We want to design computer Y to run same program in 6 seconds
 But computer Y requires 10% more cycles to execute program
 What is the clock rate for computer Y ?
 Solution:
 CPU cycles on computer X = 10 sec × 2 × 109 cycles/s = 20 × 109
 CPU cycles on computer Y = 1.1 × 20 × 109 = 22 × 109 cycles
 Clock rate for computer Y = 22 × 109 cycles / 6 sec = 3.67 GHz
Performance COE 301 – KFUPM slide 9
 Instructions take different number of cycles to execute
 Multiplication takes more time than addition
 Floating point operations take longer than integer ones
 Accessing memory takes more time than accessing registers
 CPI is an average number of clock cycles per instruction
 Important point
Changing the cycle time often changes the number of
cycles required for various instructions (more later)
Clock Cycles Per Instruction (CPI)
1
I1
cycles
I2 I3 I6
I4 I5 I7
2 3 4 5 6 7 8 9 10 11 12 13 14
CPI = 14/7 = 2
Performance COE 301 – KFUPM slide 10
 To execute, a given program will require …
 Some number of machine instructions
 Some number of clock cycles
 Some number of seconds
 We can relate CPU clock cycles to instruction count
 Performance Equation: (related to instruction count)
Performance Equation
CPU cycles = Instruction Count × CPI
Time = Instruction Count × CPI × cycle time
Performance COE 301 – KFUPM slide 11
I-Count CPI Cycle
Program X X
Compiler X X
ISA X X X
Organization X X
Technology X
Factors Impacting Performance
Time = Instruction Count × CPI × cycle time
Performance COE 301 – KFUPM slide 12
 Suppose we have two implementations of the same ISA
 For a given program
 Machine A has a clock cycle time of 250 ps and a CPI of 2.2
 Machine B has a clock cycle time of 500 ps and a CPI of 1.0
 Which machine is faster for this program, and by how much?
 Solution:
 Both computers execute same count of instructions = I
 CPU execution time (A) = I × 2.2 × 250 ps = 550 × I ps
 CPU execution time (B) = I × 1.0 × 500 ps = 500 × I ps
 Computer B is faster than A by a factor = = 1.1
Using the Performance Equation
550 × I
500 × I
Performance COE 301 – KFUPM slide 13
Determining the CPI
 Different types of instructions have different CPI
Let CPIi = clocks per instruction for class i of instructions
Let Ci = instruction count for class i of instructions
 Designers often obtain CPI by a detailed simulation
 Hardware counters are also used for operational CPUs
CPU cycles = (CPIi × Ci)
i = 1
n
∑ CPI =
(CPIi × Ci)
i = 1
n
∑
i = 1
n
∑Ci
Performance COE 301 – KFUPM slide 14
Example on Determining the CPI
 Problem
A compiler designer is trying to decide between two code sequences for a
particular machine. Based on the hardware implementation, there are three
different classes of instructions: class A, class B, and class C, and they
require one, two, and three cycles per instruction, respectively.
The first code sequence has 5 instructions: 2 of A, 1 of B, and 2 of C
The second sequence has 6 instructions: 4 of A, 1 of B, and 1 of C
Compute the CPU cycles for each sequence. Which sequence is faster?
What is the CPI for each sequence?
 Solution
CPU cycles (1st sequence) = (2×1) + (1×2) + (2×3) = 2+2+6 = 10 cycles
CPU cycles (2nd sequence) = (4×1) + (1×2) + (1×3) = 4+2+3 = 9 cycles
Second sequence is faster, even though it executes one extra instruction
CPI (1st sequence) = 10/5 = 2 CPI (2nd sequence) = 9/6 = 1.5
Performance COE 301 – KFUPM slide 15
Given: instruction mix of a program on a RISC processor
What is average CPI?
What is the percent of time used by each instruction class?
Classi Freqi CPIi
ALU 50% 1
Load 20% 5
Store 10% 3
Branch 20% 2
How faster would the machine be if load time is 2 cycles?
What if two ALU instructions could be executed at once?
Second Example on CPI
CPIi × Freqi
0.5×1 = 0.5
0.2×5 = 1.0
0.1×3 = 0.3
0.2×2 = 0.4
%Time
0.5/2.2 = 23%
1.0/2.2 = 45%
0.3/2.2 = 14%
0.4/2.2 = 18%
Average CPI = 0.5+1.0+0.3+0.4 = 2.2
Performance COE 301 – KFUPM slide 16
 MIPS: Millions Instructions Per Second
 Sometimes used as performance metric
 Faster machine  larger MIPS
 MIPS specifies instruction execution rate
 We can also relate execution time to MIPS
MIPS as a Performance Measure
Instruction Count
Execution Time × 106
Clock Rate
CPI × 106
MIPS = =
Inst Count
MIPS × 106
Inst Count × CPI
Clock Rate
Execution Time = =
Performance COE 301 – KFUPM slide 17
Drawbacks of MIPS
Three problems using MIPS as a performance metric
1. Does not take into account the capability of instructions
 Cannot use MIPS to compare computers with different
instruction sets because the instruction count will differ
2. MIPS varies between programs on the same computer
 A computer cannot have a single MIPS rating for all programs
3. MIPS can vary inversely with performance
 A higher MIPS rating does not always mean better performance
 Example in next slide shows this anomalous behavior
Performance COE 301 – KFUPM slide 18
 Two different compilers are being tested on the same
program for a 4 GHz machine with three different
classes of instructions: Class A, Class B, and Class C,
which require 1, 2, and 3 cycles, respectively.
 The instruction count produced by the first compiler is 5
billion Class A instructions, 1 billion Class B instructions,
and 1 billion Class C instructions.
 The second compiler produces 10 billion Class A
instructions, 1 billion Class B instructions, and 1 billion
Class C instructions.
 Which compiler produces a higher MIPS?
 Which compiler produces a better execution time?
MIPS example
Performance COE 301 – KFUPM slide 19
Solution to MIPS Example
 First, we find the CPU cycles for both compilers
 CPU cycles (compiler 1) = (5×1 + 1×2 + 1×3)×109 = 10×109
 CPU cycles (compiler 2) = (10×1 + 1×2 + 1×3)×109 = 15×109
 Next, we find the execution time for both compilers
 Execution time (compiler 1) = 10×109 cycles / 4×109 Hz = 2.5 sec
 Execution time (compiler 2) = 15×109 cycles / 4×109 Hz = 3.75 sec
 Compiler1 generates faster program (less execution time)
 Now, we compute MIPS rate for both compilers
 MIPS = Instruction Count / (Execution Time × 106)
 MIPS (compiler 1) = (5+1+1) × 109 / (2.5 × 106) = 2800
 MIPS (compiler 2) = (10+1+1) × 109 / (3.75 × 106) = 3200
 So, code from compiler 2 has a higher MIPS rating !!!
Performance COE 301 – KFUPM slide 20
Single- vs. Multi-cycle CPU
 Drawbacks of Single Cycle Processor: Long cycle time
 All instructions take as much time as the slowest
 Alternative Solution: Multicycle implementation
 Break down instruction execution into multiple cycles
Instruction Fetch
Store ALU Memory Write
Instruction Fetch
ALU Reg Read ALU
Instruction Fetch
Branch
Load Memory Read
Instruction Fetch
longest delay
ALU
Reg Read
Reg Read
Reg Read ALU
Instruction Fetch
Jump Decode
Reg Write
Reg Write
Performance COE 301 – KFUPM slide 21
Single- vs. Multi-cycle CPU
 Break instruction execution into five steps
 Instruction fetch
 Instruction decode and register read
 Execution, memory address calculation, or branch completion
 Memory access or ALU instruction completion
 Load instruction completion
 One step = One clock cycle (clock cycle is reduced)
 First 2 steps are the same for all instructions
Instruction # cycles Instruction # cycles
ALU & Store 4 Branch 3
Load 5 Jump 2
Performance COE 301 – KFUPM slide 22
Single- vs. Multi-cycle Performance
 Assume the following operation times for components:
 Instruction and data memories: 200 ps
 ALU and adders: 180 ps
 Decode and Register file access (read or write): 150 ps
 Ignore the delays in PC, mux, extender, and wires
 Which of the following would be faster and by how much?
 Single-cycle implementation for all instructions
 Multicycle implementation optimized for every class of instructions
 Assume the following instruction mix:
 40% ALU, 20% Loads, 10% stores, 20% branches, & 10% jumps
Performance COE 301 – KFUPM slide 23
Single- vs. Multi-cycle Performance
Instruction
Class
Instruction
Memory
Register
Read
ALU
Operation
Data
Memory
Register
Write
Total
ALU 200 150 180 150 680 ps
Load 200 150 180 200 150 880 ps
Store 200 150 180 200 730 ps
Branch 200 150 180 530 ps
Jump 200 150 350 ps
 For fixed single-cycle implementation:
 Clock cycle =
 For multi-cycle implementation:
 Clock cycle =
 Average CPI =
 Speedup =
decode and update PC
0.4×4 + 0.2×5 + 0.1×4+ 0.2×3 + 0.1×2 = 3.8
max (200, 150, 180) = 200 ps (maximum delay at any step)
880 ps determined by longest delay (load instruction)
880 ps / (3.8 × 200 ps) = 880 / 760 = 1.16
Performance COE 301 – KFUPM slide 24
Amdahl’s Law
 Amdahl's Law is a measure of Speedup
 How a computer performs after an enhancement E
 Relative to how it performed previously
 Enhancement improves a fraction f of execution time by
a factor s and the remaining time is unaffected
Performance with E
Performance before
ExTime before
ExTime with E
Speedup(E) = =
ExTime with E = ExTime before × (f /s + (1 – f ))
Speedup(E) =
(f /s + (1 – f ))
1
Performance COE 301 – KFUPM slide 25
 Suppose a program runs in 100 seconds on a machine,
with multiply instruction responsible for 80 seconds of this
time. How much do we have to improve the speed of
multiplication if we want the program to run 4 times faster?
 Solution: suppose we improve multiplication by a factor s
25 sec (4 times faster) = 80 sec / s + 20 sec
s = 80 / (25 – 20) = 80 / 5 = 16
Improve the speed of multiplication by s = 16 times
 How about making the program 5 times faster?
20 sec ( 5 times faster) = 80 sec / s + 20 sec
s = 80 / (20 – 20) = ∞ Impossible to make 5 times faster!
Example on Amdahl's Law
Performance COE 301 – KFUPM slide 26
Example 2 on Amdahl's Law
 Suppose that floating-point square root is responsible for
20% of the execution time of a graphics benchmark and
ALL FP instructions are responsible for 60%
 One proposal is to speedup FP SQRT by a factor of 10
 Alternative choice: make ALL FP instructions 2X faster, which
choice is better?
 Answer:
 Choice 1: Improve FP SQRT by a factor of 10
 Speedup (FP SQRT) = 1/(0.8 + 0.2/10) = 1.22
 Choice 2: Improve ALL FP instructions by a factor of 2
 Speedup = 1/(0.4 + 0.6/2) = 1.43  Better
Performance COE 301 – KFUPM slide 27
Benchmarks
 Performance is measured by running real applications
 Use programs typical of expected workload
 Representatives of expected classes of applications
 Examples: compilers, editors, scientific applications, graphics, ...
 SPEC (System Performance Evaluation Corporation)
 Website: www.spec.org
 Various benchmarks for CPU performance, graphics, high-
performance computing, Web servers, etc.
 Specifies rules for running list of programs and reporting results
 Valuable indicator of performance and compiler technology
 SPEC CPU 2006 (12 integer + 17 FP programs)
Performance COE 301 – KFUPM slide 28
SPEC CPU Benchmarks
 Wall clock time is used as a
performance metric
 Benchmarks measure CPU
time, because of little I/O
Performance COE 301 – KFUPM slide 29
Summarizing Performance Results
Choice of the Reference computer is
irrelevant
𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜 =
𝑇𝑖𝑚𝑒 𝑜𝑛 𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝐶𝑜𝑚𝑝𝑢𝑡𝑒𝑟
𝑇𝑖𝑚𝑒 𝑜𝑛 𝐶𝑜𝑚𝑝𝑢𝑡𝑒𝑟 𝐵𝑒𝑖𝑛𝑔 𝑅𝑎𝑡𝑒𝑑
𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝐴
𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝐵
=
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑅𝑒𝑓
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑅𝑒𝑓
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵
=
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴
𝐺𝑒𝑜𝑚𝑒𝑡𝑟𝑖𝑐 𝑀𝑒𝑎𝑛 𝑜𝑓 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝑠 =
𝑛
𝑖=1
𝑛
𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝑖
Performance COE 301 – KFUPM slide 30
Benchmark
Ultra 5
Time
(sec)
Opteron
Time
(sec)
SpecRatio
Opteron
Itanium2
Time
(sec)
SpecRatio
Itanium2
Opteron/
Itanium2
Times
Itanium2/
Opteron
SpecRatios
wupwise 1600 51.5 31.06 56.1 28.53 0.92 0.92
swim 3100 125.0 24.73 70.7 43.85 1.77 1.77
mgrid 1800 98.0 18.37 65.8 27.36 1.49 1.49
applu 2100 94.0 22.34 50.9 41.25 1.85 1.85
mesa 1400 64.6 21.69 108.0 12.99 0.60 0.60
galgel 2900 86.4 33.57 40.0 72.47 2.16 2.16
art 2600 92.4 28.13 21.0 123.67 4.40 4.40
equake 1300 72.6 17.92 36.3 35.78 2.00 2.00
facerec 1900 73.6 25.80 86.9 21.86 0.85 0.85
ammp 2200 136.0 16.14 132.0 16.63 1.03 1.03
lucas 2000 88.8 22.52 107.0 18.76 0.83 0.83
fma3d 2100 120.0 17.48 131.0 16.09 0.92 0.92
sixtrack 1100 123.0 8.95 68.8 15.99 1.79 1.79
apsi 2600 150.0 17.36 231.0 11.27 0.65 0.65
Geometric Mean 20.86 27.12 1.30 1.30
Geometric mean of ratios = 1.30 = Ratio of Geometric means = 27.12 / 20.86
Execution Times & SPEC Ratios
Performance COE 301 – KFUPM slide 31
Things to Remember
 Two common measures: Response Time and Throughput
 Response Time = duration of a single task
 Throughput is a rate = Number of tasks per duration of time
 CPU Execution Time = Instruction Count × CPI × Cycle
 MIPS = Millions of Instructions Per Second (is a rate)
 FLOPS = Floating-point Operations Per Second
 Amdahl's Law is a measure of speedup
 When improving a fraction of the execution time
 Benchmarks: real applications are used
 To compare the performance of computer systems
 Geometric mean of SPEC ratios (for a set of applications)
Performance COE 301 – KFUPM slide 32
Performance and Power
 Power is a key limitation
 Battery capacity has improved only slightly over time
 Need to design power-efficient processors
 Reduce power by
 Reducing frequency, voltage
 Putting components to sleep
 Performance per Watt: FLOPS per Watt
 Defined as performance divided by power consumption
 Important metric for energy-efficiency
Performance COE 301 – KFUPM slide 33
Power in Integrated Circuits
 Power is the biggest challenge facing computer design
 Power should be brought in and distributed around the chip
 Hundreds of pins and multiple layers just for power and ground
 Power is dissipated as heat and must be removed
 In CMOS IC technology, dynamic power is consumed
when switching transistors on and off
Dynamic Power = Capacitive Load × Voltage2 × Frequency
× 40 5V  1V × 1000
Performance COE 301 – KFUPM slide 34
Trends in Clock Rates and Power
 Power Wall: Cannot Increase the Clock Rate
 Heat must be dissipated from a 1.5 × 1.5 cm chip
 Intel 80386 (1985) consumed about 2 Watts
 Intel Core i7 running at 3.3 GHz consumes 130 Watts
 This is the limit of what can be cooled by air
Performance COE 301 – KFUPM slide 35
Example on Power Consumption
 Suppose a new CPU has
 85% of capacitive load of old CPU
 15% voltage and 15% frequency reduction
 Relate the Power consumption of the new and old CPUs
 Answer:
 The Power Wall
 We cannot reduce voltage further
 We cannot remove more heat from the integrated circuit
 How else can we improve performance?
0.52
0.85
F
V
C
0.85
F
0.85)
(V
0.85
C
P
P 4
old
2
old
old
old
2
old
old
old
new










Performance COE 301 – KFUPM slide 36
Moving to Multicores
Moving to
Multicore
Performance COE 301 – KFUPM slide 37
Processor Performance
~35000X improvement in
processor performance
between 1978 and 2012
Performance is slowed down to 22% / year due to
power consumption and memory latency
Move to multicore
Performance COE 301 – KFUPM slide 38
Multicore Processors
 Multiprocessor on a single chip
 Requires explicit parallel programming
 Harder than sequential programming
 Parallel programming to achieve higher performance
 Optimizing communication and synchronization
 Load Balancing
 In addition, each core supports instruction-level parallelism
 Parallelism at the instruction level
 Parallelism is extracted by the hardware or the compiler
 Each core executes multiple instructions each cycle

More Related Content

Similar to Kiến trúc máy tính-COE 301 - Performance.ppt

Lecture 3
Lecture 3Lecture 3
Lecture 3Mr SMAK
 
COMPUTER ARCHITECTURE BASIC CONCEPT
COMPUTER ARCHITECTURE BASIC CONCEPTCOMPUTER ARCHITECTURE BASIC CONCEPT
COMPUTER ARCHITECTURE BASIC CONCEPTAzizul Mamun
 
Measuringperformance 090527015748-phpapp01
Measuringperformance 090527015748-phpapp01Measuringperformance 090527015748-phpapp01
Measuringperformance 090527015748-phpapp01manishajadhav13j
 
11-Serial_vs_Pipelined.pptx
11-Serial_vs_Pipelined.pptx11-Serial_vs_Pipelined.pptx
11-Serial_vs_Pipelined.pptxDanyMerhej1
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu schedulingpiku das
 
Parallel Computing - Lec 6
Parallel Computing - Lec 6Parallel Computing - Lec 6
Parallel Computing - Lec 6Shah Zaib
 
Chapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyChapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyBATMUNHMUNHZAYA
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxJEEVANANTHAMG6
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSvtunotesbysree
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementationkavitha2009
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementationkavitha2009
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02Vivek chan
 
Performance of processor.ppt
Performance of processor.pptPerformance of processor.ppt
Performance of processor.pptnivedita murugan
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdfRajMantry
 
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...EUDAT
 

Similar to Kiến trúc máy tính-COE 301 - Performance.ppt (20)

Lecture 3
Lecture 3Lecture 3
Lecture 3
 
COMPUTER ARCHITECTURE BASIC CONCEPT
COMPUTER ARCHITECTURE BASIC CONCEPTCOMPUTER ARCHITECTURE BASIC CONCEPT
COMPUTER ARCHITECTURE BASIC CONCEPT
 
Measuringperformance 090527015748-phpapp01
Measuringperformance 090527015748-phpapp01Measuringperformance 090527015748-phpapp01
Measuringperformance 090527015748-phpapp01
 
11-Serial_vs_Pipelined.pptx
11-Serial_vs_Pipelined.pptx11-Serial_vs_Pipelined.pptx
11-Serial_vs_Pipelined.pptx
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Parallel Computing - Lec 6
Parallel Computing - Lec 6Parallel Computing - Lec 6
Parallel Computing - Lec 6
 
Chapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyChapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technology
 
02 performance
02 performance02 performance
02 performance
 
1571 mean
1571 mean1571 mean
1571 mean
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptx
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
 
Performance of processor.ppt
Performance of processor.pptPerformance of processor.ppt
Performance of processor.ppt
 
Computer performance
Computer performanceComputer performance
Computer performance
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
 
performance
performanceperformance
performance
 
04 performance
04 performance04 performance
04 performance
 
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
 

Recently uploaded

Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...amitlee9823
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointGetawu
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRdollysharma2066
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Naicy mandal
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...Amil baba
 
Lubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtLubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtdineshkumar430venkat
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...Call Girls in Nagpur High Profile
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...ranjana rawat
 

Recently uploaded (20)

Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power point
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
Lubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtLubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabt
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
 

Kiến trúc máy tính-COE 301 - Performance.ppt

  • 1. Performance COE 301 Computer Organization Dr. Aiman El-Maleh College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals [Adapted from slides of Dr. M. Mudawar, COE 301, KFUPM]
  • 2. Performance COE 301 – KFUPM slide 2 Outline  Response Time and Throughput  Performance and Execution Time  Clock Cycles Per Instruction (CPI)  MIPS as a Performance Measure  Single- vs. Multi-cycle CPU Performance  Amdahl’s Law  Benchmarks  Performance and Power
  • 3. Performance COE 301 – KFUPM slide 3  How can we make intelligent choices about computers?  Why some computer hardware performs better at some programs, but performs less at other programs?  How do we measure the performance of a computer?  What factors are hardware related? software related?  How does machine’s instruction set affect performance?  Understanding performance is key to understanding underlying organizational motivation What is Performance?
  • 4. Performance COE 301 – KFUPM slide 4 Response Time and Throughput  Response Time  Time between start and completion of a task, as observed by end user  Response Time = CPU Time + Waiting Time (I/O, OS scheduling, etc.)  Throughput  Number of tasks the machine can run in a given period of time  Decreasing execution time improves throughput  Example: using a faster version of a processor  Less time to run a task  more tasks can be executed  Increasing throughput can also improve response time  Example: increasing number of processors in a multiprocessor  More tasks can be executed in parallel  Execution time of individual sequential tasks is not changed  But less waiting time in scheduling queue reduces response time
  • 5. Performance COE 301 – KFUPM slide 5  For some program running on machine X  X is n times faster than Y Book’s Definition of Performance Execution timeX 1 PerformanceX = PerformanceY PerformanceX Execution timeX Execution timeY = n =
  • 6. Performance COE 301 – KFUPM slide 6  Real Elapsed Time  Counts everything:  Waiting time, Input/output, disk access, OS scheduling, … etc.  Useful number, but often not good for comparison purposes  Our Focus: CPU Execution Time  Time spent while executing the program instructions  Doesn't count the waiting time for I/O or OS scheduling  Can be measured in seconds, or  Can be related to number of CPU clock cycles What do we mean by Execution Time?
  • 7. Performance COE 301 – KFUPM slide 7  Clock cycle = Clock period = 1 / Clock rate  Clock rate = Clock frequency = Cycles per second  1 Hz = 1 cycle/sec 1 KHz = 103 cycles/sec  1 MHz = 106 cycles/sec 1 GHz = 109 cycles/sec  2 GHz clock has a cycle time = 1/(2×109) = 0.5 nanosecond (ns)  We often use clock cycles to report CPU execution time Clock Cycles Cycle 1 Cycle 2 Cycle 3 CPU Execution Time = CPU cycles × cycle time Clock rate CPU cycles =
  • 8. Performance COE 301 – KFUPM slide 8 Improving Performance  To improve performance, we need to  Reduce number of clock cycles required by a program, or  Reduce clock cycle time (increase the clock rate)  Example:  A program runs in 10 seconds on computer X with 2 GHz clock  What is the number of CPU cycles on computer X ?  We want to design computer Y to run same program in 6 seconds  But computer Y requires 10% more cycles to execute program  What is the clock rate for computer Y ?  Solution:  CPU cycles on computer X = 10 sec × 2 × 109 cycles/s = 20 × 109  CPU cycles on computer Y = 1.1 × 20 × 109 = 22 × 109 cycles  Clock rate for computer Y = 22 × 109 cycles / 6 sec = 3.67 GHz
  • 9. Performance COE 301 – KFUPM slide 9  Instructions take different number of cycles to execute  Multiplication takes more time than addition  Floating point operations take longer than integer ones  Accessing memory takes more time than accessing registers  CPI is an average number of clock cycles per instruction  Important point Changing the cycle time often changes the number of cycles required for various instructions (more later) Clock Cycles Per Instruction (CPI) 1 I1 cycles I2 I3 I6 I4 I5 I7 2 3 4 5 6 7 8 9 10 11 12 13 14 CPI = 14/7 = 2
  • 10. Performance COE 301 – KFUPM slide 10  To execute, a given program will require …  Some number of machine instructions  Some number of clock cycles  Some number of seconds  We can relate CPU clock cycles to instruction count  Performance Equation: (related to instruction count) Performance Equation CPU cycles = Instruction Count × CPI Time = Instruction Count × CPI × cycle time
  • 11. Performance COE 301 – KFUPM slide 11 I-Count CPI Cycle Program X X Compiler X X ISA X X X Organization X X Technology X Factors Impacting Performance Time = Instruction Count × CPI × cycle time
  • 12. Performance COE 301 – KFUPM slide 12  Suppose we have two implementations of the same ISA  For a given program  Machine A has a clock cycle time of 250 ps and a CPI of 2.2  Machine B has a clock cycle time of 500 ps and a CPI of 1.0  Which machine is faster for this program, and by how much?  Solution:  Both computers execute same count of instructions = I  CPU execution time (A) = I × 2.2 × 250 ps = 550 × I ps  CPU execution time (B) = I × 1.0 × 500 ps = 500 × I ps  Computer B is faster than A by a factor = = 1.1 Using the Performance Equation 550 × I 500 × I
  • 13. Performance COE 301 – KFUPM slide 13 Determining the CPI  Different types of instructions have different CPI Let CPIi = clocks per instruction for class i of instructions Let Ci = instruction count for class i of instructions  Designers often obtain CPI by a detailed simulation  Hardware counters are also used for operational CPUs CPU cycles = (CPIi × Ci) i = 1 n ∑ CPI = (CPIi × Ci) i = 1 n ∑ i = 1 n ∑Ci
  • 14. Performance COE 301 – KFUPM slide 14 Example on Determining the CPI  Problem A compiler designer is trying to decide between two code sequences for a particular machine. Based on the hardware implementation, there are three different classes of instructions: class A, class B, and class C, and they require one, two, and three cycles per instruction, respectively. The first code sequence has 5 instructions: 2 of A, 1 of B, and 2 of C The second sequence has 6 instructions: 4 of A, 1 of B, and 1 of C Compute the CPU cycles for each sequence. Which sequence is faster? What is the CPI for each sequence?  Solution CPU cycles (1st sequence) = (2×1) + (1×2) + (2×3) = 2+2+6 = 10 cycles CPU cycles (2nd sequence) = (4×1) + (1×2) + (1×3) = 4+2+3 = 9 cycles Second sequence is faster, even though it executes one extra instruction CPI (1st sequence) = 10/5 = 2 CPI (2nd sequence) = 9/6 = 1.5
  • 15. Performance COE 301 – KFUPM slide 15 Given: instruction mix of a program on a RISC processor What is average CPI? What is the percent of time used by each instruction class? Classi Freqi CPIi ALU 50% 1 Load 20% 5 Store 10% 3 Branch 20% 2 How faster would the machine be if load time is 2 cycles? What if two ALU instructions could be executed at once? Second Example on CPI CPIi × Freqi 0.5×1 = 0.5 0.2×5 = 1.0 0.1×3 = 0.3 0.2×2 = 0.4 %Time 0.5/2.2 = 23% 1.0/2.2 = 45% 0.3/2.2 = 14% 0.4/2.2 = 18% Average CPI = 0.5+1.0+0.3+0.4 = 2.2
  • 16. Performance COE 301 – KFUPM slide 16  MIPS: Millions Instructions Per Second  Sometimes used as performance metric  Faster machine  larger MIPS  MIPS specifies instruction execution rate  We can also relate execution time to MIPS MIPS as a Performance Measure Instruction Count Execution Time × 106 Clock Rate CPI × 106 MIPS = = Inst Count MIPS × 106 Inst Count × CPI Clock Rate Execution Time = =
  • 17. Performance COE 301 – KFUPM slide 17 Drawbacks of MIPS Three problems using MIPS as a performance metric 1. Does not take into account the capability of instructions  Cannot use MIPS to compare computers with different instruction sets because the instruction count will differ 2. MIPS varies between programs on the same computer  A computer cannot have a single MIPS rating for all programs 3. MIPS can vary inversely with performance  A higher MIPS rating does not always mean better performance  Example in next slide shows this anomalous behavior
  • 18. Performance COE 301 – KFUPM slide 18  Two different compilers are being tested on the same program for a 4 GHz machine with three different classes of instructions: Class A, Class B, and Class C, which require 1, 2, and 3 cycles, respectively.  The instruction count produced by the first compiler is 5 billion Class A instructions, 1 billion Class B instructions, and 1 billion Class C instructions.  The second compiler produces 10 billion Class A instructions, 1 billion Class B instructions, and 1 billion Class C instructions.  Which compiler produces a higher MIPS?  Which compiler produces a better execution time? MIPS example
  • 19. Performance COE 301 – KFUPM slide 19 Solution to MIPS Example  First, we find the CPU cycles for both compilers  CPU cycles (compiler 1) = (5×1 + 1×2 + 1×3)×109 = 10×109  CPU cycles (compiler 2) = (10×1 + 1×2 + 1×3)×109 = 15×109  Next, we find the execution time for both compilers  Execution time (compiler 1) = 10×109 cycles / 4×109 Hz = 2.5 sec  Execution time (compiler 2) = 15×109 cycles / 4×109 Hz = 3.75 sec  Compiler1 generates faster program (less execution time)  Now, we compute MIPS rate for both compilers  MIPS = Instruction Count / (Execution Time × 106)  MIPS (compiler 1) = (5+1+1) × 109 / (2.5 × 106) = 2800  MIPS (compiler 2) = (10+1+1) × 109 / (3.75 × 106) = 3200  So, code from compiler 2 has a higher MIPS rating !!!
  • 20. Performance COE 301 – KFUPM slide 20 Single- vs. Multi-cycle CPU  Drawbacks of Single Cycle Processor: Long cycle time  All instructions take as much time as the slowest  Alternative Solution: Multicycle implementation  Break down instruction execution into multiple cycles Instruction Fetch Store ALU Memory Write Instruction Fetch ALU Reg Read ALU Instruction Fetch Branch Load Memory Read Instruction Fetch longest delay ALU Reg Read Reg Read Reg Read ALU Instruction Fetch Jump Decode Reg Write Reg Write
  • 21. Performance COE 301 – KFUPM slide 21 Single- vs. Multi-cycle CPU  Break instruction execution into five steps  Instruction fetch  Instruction decode and register read  Execution, memory address calculation, or branch completion  Memory access or ALU instruction completion  Load instruction completion  One step = One clock cycle (clock cycle is reduced)  First 2 steps are the same for all instructions Instruction # cycles Instruction # cycles ALU & Store 4 Branch 3 Load 5 Jump 2
  • 22. Performance COE 301 – KFUPM slide 22 Single- vs. Multi-cycle Performance  Assume the following operation times for components:  Instruction and data memories: 200 ps  ALU and adders: 180 ps  Decode and Register file access (read or write): 150 ps  Ignore the delays in PC, mux, extender, and wires  Which of the following would be faster and by how much?  Single-cycle implementation for all instructions  Multicycle implementation optimized for every class of instructions  Assume the following instruction mix:  40% ALU, 20% Loads, 10% stores, 20% branches, & 10% jumps
  • 23. Performance COE 301 – KFUPM slide 23 Single- vs. Multi-cycle Performance Instruction Class Instruction Memory Register Read ALU Operation Data Memory Register Write Total ALU 200 150 180 150 680 ps Load 200 150 180 200 150 880 ps Store 200 150 180 200 730 ps Branch 200 150 180 530 ps Jump 200 150 350 ps  For fixed single-cycle implementation:  Clock cycle =  For multi-cycle implementation:  Clock cycle =  Average CPI =  Speedup = decode and update PC 0.4×4 + 0.2×5 + 0.1×4+ 0.2×3 + 0.1×2 = 3.8 max (200, 150, 180) = 200 ps (maximum delay at any step) 880 ps determined by longest delay (load instruction) 880 ps / (3.8 × 200 ps) = 880 / 760 = 1.16
  • 24. Performance COE 301 – KFUPM slide 24 Amdahl’s Law  Amdahl's Law is a measure of Speedup  How a computer performs after an enhancement E  Relative to how it performed previously  Enhancement improves a fraction f of execution time by a factor s and the remaining time is unaffected Performance with E Performance before ExTime before ExTime with E Speedup(E) = = ExTime with E = ExTime before × (f /s + (1 – f )) Speedup(E) = (f /s + (1 – f )) 1
  • 25. Performance COE 301 – KFUPM slide 25  Suppose a program runs in 100 seconds on a machine, with multiply instruction responsible for 80 seconds of this time. How much do we have to improve the speed of multiplication if we want the program to run 4 times faster?  Solution: suppose we improve multiplication by a factor s 25 sec (4 times faster) = 80 sec / s + 20 sec s = 80 / (25 – 20) = 80 / 5 = 16 Improve the speed of multiplication by s = 16 times  How about making the program 5 times faster? 20 sec ( 5 times faster) = 80 sec / s + 20 sec s = 80 / (20 – 20) = ∞ Impossible to make 5 times faster! Example on Amdahl's Law
  • 26. Performance COE 301 – KFUPM slide 26 Example 2 on Amdahl's Law  Suppose that floating-point square root is responsible for 20% of the execution time of a graphics benchmark and ALL FP instructions are responsible for 60%  One proposal is to speedup FP SQRT by a factor of 10  Alternative choice: make ALL FP instructions 2X faster, which choice is better?  Answer:  Choice 1: Improve FP SQRT by a factor of 10  Speedup (FP SQRT) = 1/(0.8 + 0.2/10) = 1.22  Choice 2: Improve ALL FP instructions by a factor of 2  Speedup = 1/(0.4 + 0.6/2) = 1.43  Better
  • 27. Performance COE 301 – KFUPM slide 27 Benchmarks  Performance is measured by running real applications  Use programs typical of expected workload  Representatives of expected classes of applications  Examples: compilers, editors, scientific applications, graphics, ...  SPEC (System Performance Evaluation Corporation)  Website: www.spec.org  Various benchmarks for CPU performance, graphics, high- performance computing, Web servers, etc.  Specifies rules for running list of programs and reporting results  Valuable indicator of performance and compiler technology  SPEC CPU 2006 (12 integer + 17 FP programs)
  • 28. Performance COE 301 – KFUPM slide 28 SPEC CPU Benchmarks  Wall clock time is used as a performance metric  Benchmarks measure CPU time, because of little I/O
  • 29. Performance COE 301 – KFUPM slide 29 Summarizing Performance Results Choice of the Reference computer is irrelevant 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜 = 𝑇𝑖𝑚𝑒 𝑜𝑛 𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝐶𝑜𝑚𝑝𝑢𝑡𝑒𝑟 𝑇𝑖𝑚𝑒 𝑜𝑛 𝐶𝑜𝑚𝑝𝑢𝑡𝑒𝑟 𝐵𝑒𝑖𝑛𝑔 𝑅𝑎𝑡𝑒𝑑 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝐴 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝐵 = 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑅𝑒𝑓 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑅𝑒𝑓 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵 = 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴 𝐺𝑒𝑜𝑚𝑒𝑡𝑟𝑖𝑐 𝑀𝑒𝑎𝑛 𝑜𝑓 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝑠 = 𝑛 𝑖=1 𝑛 𝑆𝑃𝐸𝐶 𝑅𝑎𝑡𝑖𝑜𝑖
  • 30. Performance COE 301 – KFUPM slide 30 Benchmark Ultra 5 Time (sec) Opteron Time (sec) SpecRatio Opteron Itanium2 Time (sec) SpecRatio Itanium2 Opteron/ Itanium2 Times Itanium2/ Opteron SpecRatios wupwise 1600 51.5 31.06 56.1 28.53 0.92 0.92 swim 3100 125.0 24.73 70.7 43.85 1.77 1.77 mgrid 1800 98.0 18.37 65.8 27.36 1.49 1.49 applu 2100 94.0 22.34 50.9 41.25 1.85 1.85 mesa 1400 64.6 21.69 108.0 12.99 0.60 0.60 galgel 2900 86.4 33.57 40.0 72.47 2.16 2.16 art 2600 92.4 28.13 21.0 123.67 4.40 4.40 equake 1300 72.6 17.92 36.3 35.78 2.00 2.00 facerec 1900 73.6 25.80 86.9 21.86 0.85 0.85 ammp 2200 136.0 16.14 132.0 16.63 1.03 1.03 lucas 2000 88.8 22.52 107.0 18.76 0.83 0.83 fma3d 2100 120.0 17.48 131.0 16.09 0.92 0.92 sixtrack 1100 123.0 8.95 68.8 15.99 1.79 1.79 apsi 2600 150.0 17.36 231.0 11.27 0.65 0.65 Geometric Mean 20.86 27.12 1.30 1.30 Geometric mean of ratios = 1.30 = Ratio of Geometric means = 27.12 / 20.86 Execution Times & SPEC Ratios
  • 31. Performance COE 301 – KFUPM slide 31 Things to Remember  Two common measures: Response Time and Throughput  Response Time = duration of a single task  Throughput is a rate = Number of tasks per duration of time  CPU Execution Time = Instruction Count × CPI × Cycle  MIPS = Millions of Instructions Per Second (is a rate)  FLOPS = Floating-point Operations Per Second  Amdahl's Law is a measure of speedup  When improving a fraction of the execution time  Benchmarks: real applications are used  To compare the performance of computer systems  Geometric mean of SPEC ratios (for a set of applications)
  • 32. Performance COE 301 – KFUPM slide 32 Performance and Power  Power is a key limitation  Battery capacity has improved only slightly over time  Need to design power-efficient processors  Reduce power by  Reducing frequency, voltage  Putting components to sleep  Performance per Watt: FLOPS per Watt  Defined as performance divided by power consumption  Important metric for energy-efficiency
  • 33. Performance COE 301 – KFUPM slide 33 Power in Integrated Circuits  Power is the biggest challenge facing computer design  Power should be brought in and distributed around the chip  Hundreds of pins and multiple layers just for power and ground  Power is dissipated as heat and must be removed  In CMOS IC technology, dynamic power is consumed when switching transistors on and off Dynamic Power = Capacitive Load × Voltage2 × Frequency × 40 5V  1V × 1000
  • 34. Performance COE 301 – KFUPM slide 34 Trends in Clock Rates and Power  Power Wall: Cannot Increase the Clock Rate  Heat must be dissipated from a 1.5 × 1.5 cm chip  Intel 80386 (1985) consumed about 2 Watts  Intel Core i7 running at 3.3 GHz consumes 130 Watts  This is the limit of what can be cooled by air
  • 35. Performance COE 301 – KFUPM slide 35 Example on Power Consumption  Suppose a new CPU has  85% of capacitive load of old CPU  15% voltage and 15% frequency reduction  Relate the Power consumption of the new and old CPUs  Answer:  The Power Wall  We cannot reduce voltage further  We cannot remove more heat from the integrated circuit  How else can we improve performance? 0.52 0.85 F V C 0.85 F 0.85) (V 0.85 C P P 4 old 2 old old old 2 old old old new          
  • 36. Performance COE 301 – KFUPM slide 36 Moving to Multicores Moving to Multicore
  • 37. Performance COE 301 – KFUPM slide 37 Processor Performance ~35000X improvement in processor performance between 1978 and 2012 Performance is slowed down to 22% / year due to power consumption and memory latency Move to multicore
  • 38. Performance COE 301 – KFUPM slide 38 Multicore Processors  Multiprocessor on a single chip  Requires explicit parallel programming  Harder than sequential programming  Parallel programming to achieve higher performance  Optimizing communication and synchronization  Load Balancing  In addition, each core supports instruction-level parallelism  Parallelism at the instruction level  Parallelism is extracted by the hardware or the compiler  Each core executes multiple instructions each cycle