Measuring Performance November 17, 2008 Measuring Performance - - PowerPoint PPT Presentation

measuring performance
SMART_READER_LITE
LIVE PREVIEW

Measuring Performance November 17, 2008 Measuring Performance - - PowerPoint PPT Presentation

Introduction CPU Peformance and Its Factors Evaluating Performance Measuring Performance November 17, 2008 Measuring Performance Introduction CPU Peformance and Its Factors Evaluating Performance Outline 1 Introduction 2 CPU Peformance and


slide-1
SLIDE 1

Introduction CPU Peformance and Its Factors Evaluating Performance

Measuring Performance

November 17, 2008

Measuring Performance

slide-2
SLIDE 2

Introduction CPU Peformance and Its Factors Evaluating Performance

Outline

1 Introduction 2 CPU Peformance and Its Factors 3 Evaluating Performance

Measuring Performance

slide-3
SLIDE 3

Introduction CPU Peformance and Its Factors Evaluating Performance

Some measures of Peformance

High throughput Short respone time Scalability

Measuring Performance

slide-4
SLIDE 4

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?”

Measuring Performance

slide-5
SLIDE 5

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?” Measure, evaluate

Measuring Performance

slide-6
SLIDE 6

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?” Measure, evaluate Tough: complex software + optimized hardware Hardware:

CPU: many metrics

Measuring Performance

slide-7
SLIDE 7

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?” Measure, evaluate Tough: complex software + optimized hardware Hardware:

CPU: many metrics Memory Graphics

Measuring Performance

slide-8
SLIDE 8

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?” Measure, evaluate Tough: complex software + optimized hardware Hardware:

CPU: many metrics Memory Graphics

Software: needs vary

Measuring Performance

slide-9
SLIDE 9

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance

“How fast?” Measure, evaluate Tough: complex software + optimized hardware Hardware:

CPU: many metrics Memory Graphics

Software: needs vary Consumer: GHz, MB . . . ?

Measuring Performance

slide-10
SLIDE 10

Introduction CPU Peformance and Its Factors Evaluating Performance

Our Concern

From inside What determines computer performance?

Measuring Performance

slide-11
SLIDE 11

Introduction CPU Peformance and Its Factors Evaluating Performance

Our Concern

From inside What determines computer performance? Answer:

Why is a software slow / fast? Why implementations of ISs can perform better / worse? How hardware pieces affect performance?

Measuring Performance

slide-12
SLIDE 12

Introduction CPU Peformance and Its Factors Evaluating Performance

Defining Performance

PerformanceComputerX > ComputerComputerY

Measuring Performance

slide-13
SLIDE 13

Introduction CPU Peformance and Its Factors Evaluating Performance

Defining Performance

PerformanceComputerX > ComputerComputerY ?

Measuring Performance

slide-14
SLIDE 14

Introduction CPU Peformance and Its Factors Evaluating Performance

Judging Performance

Figure: Statistics of some aircraft models

Measuring Performance

slide-15
SLIDE 15

Introduction CPU Peformance and Its Factors Evaluating Performance

Basic Metrics

Response time: time for single task Throughput: amount of work done per unit time

Measuring Performance

slide-16
SLIDE 16

Introduction CPU Peformance and Its Factors Evaluating Performance

Throughput and Response Time

Which is improved in these cases:

Upgrading to a faster processor? Upgrading to a multi-core processor?

Measuring Performance

slide-17
SLIDE 17

Introduction CPU Peformance and Its Factors Evaluating Performance

Response Time

Main metric

Measuring Performance

slide-18
SLIDE 18

Introduction CPU Peformance and Its Factors Evaluating Performance

Response Time

Main metric max(Performance) ⇒ min(respTime)

Measuring Performance

slide-19
SLIDE 19

Introduction CPU Peformance and Its Factors Evaluating Performance

Response Time

Main metric max(Performance) ⇒ min(respTime) Performance = 1 ExecutionTime

Measuring Performance

slide-20
SLIDE 20

Introduction CPU Peformance and Its Factors Evaluating Performance

Response Time

Main metric max(Performance) ⇒ min(respTime) Performance = 1 ExecutionTime ∴, if PerformanceX > PerformanceY =⇒ ExecutionTimeY > ExecutionTimeX

Measuring Performance

slide-21
SLIDE 21

Introduction CPU Peformance and Its Factors Evaluating Performance

Relative Performance

X is n times faster than Y =⇒ PerformanceX PerformanceY = ExecutionTimeY ExecutionTimeX = n

Measuring Performance

slide-22
SLIDE 22

Introduction CPU Peformance and Its Factors Evaluating Performance

Relative Performance

X is n times faster than Y =⇒ PerformanceX PerformanceY = ExecutionTimeY ExecutionTimeX = n ∴, improve performance =⇒ descrease execution time

Measuring Performance

slide-23
SLIDE 23

Introduction CPU Peformance and Its Factors Evaluating Performance

Measuring Performance

Settled on time as metric Execution time / program

Measuring Performance

slide-24
SLIDE 24

Introduction CPU Peformance and Its Factors Evaluating Performance

Measuring Performance

Settled on time as metric Execution time / program Formally wall-clock/execution/response time

Total time to complete everything for a task (CPU + I/O + Memory + OS + . . . )

Measuring Performance

slide-25
SLIDE 25

Introduction CPU Peformance and Its Factors Evaluating Performance

CPU Execution Time

Often, multi-processing OS ∴, goal: throughput

Measuring Performance

slide-26
SLIDE 26

Introduction CPU Peformance and Its Factors Evaluating Performance

CPU Execution Time

Often, multi-processing OS ∴, goal: throughput CPU (Execution) time: CPU’s devotion to a single program

exclude I/O or other programs

Measuring Performance

slide-27
SLIDE 27

Introduction CPU Peformance and Its Factors Evaluating Performance

CPU Execution Time

Often, multi-processing OS ∴, goal: throughput CPU (Execution) time: CPU’s devotion to a single program

exclude I/O or other programs

= user CPU time + system CPU time

Measuring Performance

slide-28
SLIDE 28

Introduction CPU Peformance and Its Factors Evaluating Performance

Clock Cycles

More precise metric Clock cycles

Also, tick, clock tick, period, clock period

Measured by a crystal oscillator Clock rate/period

Measuring Performance

slide-29
SLIDE 29

Introduction CPU Peformance and Its Factors Evaluating Performance

Outline

1 Introduction 2 CPU Peformance and Its Factors 3 Evaluating Performance

Measuring Performance

slide-30
SLIDE 30

Introduction CPU Peformance and Its Factors Evaluating Performance

CPU Performance

Relate user and designer metrics For a program: CPU Execution time = CPU clock cycles ∗ Clock cycle time = CPU clock cycles Clock rate Execution time: user experience Cycles and clock rate: designer metrics

Measuring Performance

slide-31
SLIDE 31

Introduction CPU Peformance and Its Factors Evaluating Performance

Example

Program execution on CPU A (4 GHz)

10 seconds

Same program on future CPU B

6 seconds (hopefully)

Improved design will cost 1.2 times more cycles for same program ClockSpeedB?

8 GHz

Measuring Performance

slide-32
SLIDE 32

Introduction CPU Peformance and Its Factors Evaluating Performance

Cycles Per Instruction

Relate to number of instructions in program Clock Cycles per Instruction (CPI)

average for all instructions examples for some instructions costlier than some others?

CPI: Good measure of implementations of same architecture ∴, for a program: Cycles = No. of instructions × Average CPI

Measuring Performance

slide-33
SLIDE 33

Introduction CPU Peformance and Its Factors Evaluating Performance

Rephrasing the Performance Equation

CPU time = Instruction count × CPI × Clock cycle time = Instruction count × CPI Clock rate

Measuring Performance

slide-34
SLIDE 34

Introduction CPU Peformance and Its Factors Evaluating Performance

Measuring the factors

CPU time: use a watch Clock rate/period: comes with CPU specs Instructions Count:

Software: profilers, hardware simulators Hardware: CPU counters

CPI:

hardware counters

Measuring Performance

slide-35
SLIDE 35

Introduction CPU Peformance and Its Factors Evaluating Performance

Measuring the factors

CPU time: use a watch Clock rate/period: comes with CPU specs Instructions Count:

Software: profilers, hardware simulators Hardware: CPU counters

CPI:

hardware counters

  • No. of cycles

n

i=1 CPIi × Ci

Measuring Performance

slide-36
SLIDE 36

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Measuring Performance

slide-37
SLIDE 37

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Measuring Performance

slide-38
SLIDE 38

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Measuring Performance

slide-39
SLIDE 39

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Instruction count, CPI

Measuring Performance

slide-40
SLIDE 40

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Instruction count, CPI

Compiler for the program

Measuring Performance

slide-41
SLIDE 41

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Instruction count, CPI

Compiler for the program

Instruction count, CPI

Measuring Performance

slide-42
SLIDE 42

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Instruction count, CPI

Compiler for the program

Instruction count, CPI

Instruction Architecture for the program

Measuring Performance

slide-43
SLIDE 43

Introduction CPU Peformance and Its Factors Evaluating Performance

Component Effect on Performance

What are the factors that affect performance of a program and on what metrics? Algorithm of the program

Instruction count, (possibly) CPI

Programming language of the program

Instruction count, CPI

Compiler for the program

Instruction count, CPI

Instruction Architecture for the program

all: instruction count, CPI, clock rate

Measuring Performance

slide-44
SLIDE 44

Introduction CPU Peformance and Its Factors Evaluating Performance

Example of Code Segment Performance

Decision for a compiler designer Consider following CPI’s CPI for this instruction class A B C CPI 1 2 3

Measuring Performance

slide-45
SLIDE 45

Introduction CPU Peformance and Its Factors Evaluating Performance

Example of Code Segment Performance

Decision for a compiler designer Consider following CPI’s CPI for this instruction class A B C CPI 1 2 3 For a HLL statement, alternative AL code sequences Instruction counts for instruction class A B C x 2 1 2 y 4 1 1

Measuring Performance

slide-46
SLIDE 46

Introduction CPU Peformance and Its Factors Evaluating Performance

Example of Code Segment Performance

Decision for a compiler designer Consider following CPI’s CPI for this instruction class A B C CPI 1 2 3 For a HLL statement, alternative AL code sequences Instruction counts for instruction class A B C x 2 1 2 y 4 1 1 Calculate clock cycles for both

Measuring Performance

slide-47
SLIDE 47

Introduction CPU Peformance and Its Factors Evaluating Performance

Example of Code Segment Performance

Decision for a compiler designer Consider following CPI’s CPI for this instruction class A B C CPI 1 2 3 For a HLL statement, alternative AL code sequences Instruction counts for instruction class A B C x 2 1 2 y 4 1 1 Calculate clock cycles for both Calculate CPI for both sequences ∴, look at all 3 factors when evaluating performance

Measuring Performance

slide-48
SLIDE 48

Introduction CPU Peformance and Its Factors Evaluating Performance

Another Example

A Java program runs in 12 seconds on a PC New Java compiler will need 0.6 times the instructions

increases CPI by 1.1

Compare performance of program with new compiler

Measuring Performance

slide-49
SLIDE 49

Introduction CPU Peformance and Its Factors Evaluating Performance

Effect of Improvement

Consider a program with: 25% floating point + 75 % rest

Measuring Performance

slide-50
SLIDE 50

Introduction CPU Peformance and Its Factors Evaluating Performance

Effect of Improvement

Consider a program with: 25% floating point + 75 % rest If FP improves by factor of 5, total improvement?

Measuring Performance

slide-51
SLIDE 51

Introduction CPU Peformance and Its Factors Evaluating Performance

Effect of Improvement

Consider a program with: 25% floating point + 75 % rest If FP improves by factor of 5, total improvement? Amdahl’s law: ET after improvement = ET of unimproved part+ ET of improved part amount of improvement

Measuring Performance

slide-52
SLIDE 52

Introduction CPU Peformance and Its Factors Evaluating Performance

Outline

1 Introduction 2 CPU Peformance and Its Factors 3 Evaluating Performance

Measuring Performance

slide-53
SLIDE 53

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Measuring Performance

slide-54
SLIDE 54

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Benchmark

set of representative programs run on different programs

Measuring Performance

slide-55
SLIDE 55

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Benchmark

set of representative programs run on different programs

Benchmark applications should come from real world

User-environment specific

Reproducible

Measuring Performance

slide-56
SLIDE 56

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Benchmark

set of representative programs run on different programs

Benchmark applications should come from real world

User-environment specific

Reproducible

Choose inputs that trigger commonly-used instructions

Measuring Performance

slide-57
SLIDE 57

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Benchmark

set of representative programs run on different programs

Benchmark applications should come from real world

User-environment specific

Reproducible

Choose inputs that trigger commonly-used instructions Input affects memory most

Measuring Performance

slide-58
SLIDE 58

Introduction CPU Peformance and Its Factors Evaluating Performance

Performance Evaluation

Workload: set of programs run on a computer

To evaluate, user runs workload on different computers

Benchmark

set of representative programs run on different programs

Benchmark applications should come from real world

User-environment specific

Reproducible

Choose inputs that trigger commonly-used instructions Input affects memory most

Optimization (compiler, IA, hardware, . . . ) may be benchmark-specific

Measuring Performance

slide-59
SLIDE 59

Introduction CPU Peformance and Its Factors Evaluating Performance

Comparing and Summarizing Performance

Results of a Benchmark Computer A Computer B Program 1 (secs) 1 10 Program 2 1000 100 Total Time 1001 110

Measuring Performance

slide-60
SLIDE 60

Introduction CPU Peformance and Its Factors Evaluating Performance

Artithmetic Mean

If running multiple programs AM = 1 n

n

  • i=1

Timei where, Timei is execution time for ith program

Measuring Performance

slide-61
SLIDE 61

Introduction CPU Peformance and Its Factors Evaluating Performance

Artithmetic Mean

If running multiple programs AM = 1 n

n

  • i=1

Timei where, Timei is execution time for ith program Weighted AM = 1 ntotal

n

  • i=1

Timei × freqi

Measuring Performance

slide-62
SLIDE 62

Introduction CPU Peformance and Its Factors Evaluating Performance

SPEC benchmark

Weighted running time for programs Source code

Fortran or C Compiled

Web servers, floating point, file transfer

Measuring Performance

slide-63
SLIDE 63

Introduction CPU Peformance and Its Factors Evaluating Performance

MIPS

Miilion Instructions Per Second MIPS = Instruction Count Execution Time × 106

Measuring Performance

slide-64
SLIDE 64

Introduction CPU Peformance and Its Factors Evaluating Performance

MIPS

Miilion Instructions Per Second MIPS = Instruction Count Execution Time × 106 Intuitive

Measuring Performance

slide-65
SLIDE 65

Introduction CPU Peformance and Its Factors Evaluating Performance

MIPS

Miilion Instructions Per Second MIPS = Instruction Count Execution Time × 106 Intuitive Problems

cannot compare different IAs differs for different programs

Measuring Performance