21
Performance (metrics for measuring the performance of a computer system) Mehran Mehran Rezaei Rezaei

Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

Performance (metrics

for measuring the performance of a

computer system)

MehranMehran RezaeiRezaei

Page 2: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

2

Overview

• Review of the previous lecture

• Introduction (how to measure performance)

• Metrics

• Relationships among the metrics

Page 3: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

3

Two notions of “performance”

° Time to do the task

– execution time, elapsed time, latency

° Tasks per day, hour, week, sec, ns. ..

– throughput, bandwidth

Elapsed time and throughput often are in opposition

Plane

Boeing 747

BAD/Sud Concorde

Speed

610 mph

1350 mph

DC to Paris

6.5 hours

3 hours

Passengers

470

132

Throughput (pmph)

286,700

178,200

Which has higher performance?

Page 4: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

4

Example

• Time of Concorde vs. Boeing 747? – Concord is 1350 mph / 610 mph = 2.2 times faster

– = 6.5 hours / 3 hours

• Throughput of Concorde vs. Boeing 747 ? – Concord is 178,200 pmph / 286,700 pmph = 0.62 “times

faster”

– Boeing is 286,700 pmph / 178,200 pmph = 1.6 “times faster”

• Boeing is 1.6 times (“60%”)faster in terms of throughput

• Concord is 2.2 times (“120%”) faster in terms of flying time

• We will focus primarily on execution time for a single job

Page 5: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

5

Definitions

• Performance is in units of things-per-second

–higher is better

• If we are primarily concerned with response

time

performance(x) = 1

execution_time(x)

" X is n times faster than Y" means

Performance(X) n = ----------------- Performance(Y)

Page 6: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

6

Example

• If machine A runs a program in 10

seconds and machine B runs the same

program in 15 seconds, which machine

is faster and by how much?

Increase performance = Decrease execution

time

To me is a bit confusing

Improve performance = Improve execution

time

Page 7: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

9

• For the first few chapters we focus on

CPU time

– User CPU time

– System CPU time

• Time Utility of UNIX 140.3u 39.5s 7:23 41%

0.41=(140.3+39.5)/443

About 59% of the elapsed time was used for

I/O and some other stuff (I/O bound).

Execution time

Page 8: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

10

System CPU time vs. User CPU time

• Which one do you think reflects the

performance of the system (better)?

• From now on:

If system performance

Elapsed time

If CPU performance

User CPU time

Page 9: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

11

Finally

• Clock rate and clock period

I call them CF and CT

CF=1/CT

• CPU Execution time=

# of Cycles for program * CT =

# of Cycles for program/CF

Page 10: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

12

Example

• A program runs in 10 seconds on computer

A, which has 400 MHz clock. We are trying to

help a computer designer build a machine, B,

that will run this program in 6 seconds. The

designer has determined that a substantial

increase in the clock rate is possible, but this

increase will affect the rest of the CPU

design, causing machine B to require 1.2

times as many clock cycles as machine A for

this program. What clock rate should we ask

the designer to target for machine B?

Page 11: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

13

The final Formula

Execution time =

Total number of cycles for program * CT =

Total number of Instruction *

Average number of cycles per Instruction *

CT =

Instruction Count*

Average Cycles per Instruction*

CT =

IC * CPI * CT

Page 12: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

16

Example

• Suppose we have two implementations

of the same instruction set architecture.

Machine A has a clock cycle time of 1

ns and a CPI of 2.0 for program p.

Machine B has a clock cycle time of 2

ns and a CPI of 1.2 for the same

program. Which machine is faster for

this program, and by how much?

Page 13: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

17

How could you measure them?

Execution time =

Total number of cycles for program * CT =

Total number of Instruction *

Average number of cycles per Instruction *

CT =

Instruction Count*

Average Cycles per Instruction*

CT =

IC * CPI * CT

Page 14: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

18

Do not forget that,

• Clock rate and clock period

I call CF and CT

CF=1/CT

• CPU Execution time=

# of Cycles for program * CT =

# of Cycles for program/CF

Page 15: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

19

Clock Cycles

Instead of reporting execution time in seconds, we often use

cycles

Clock “ticks” indicate when to start activities (one abstraction):

cycle time = time between ticks = seconds per cycle

clock rate (frequency) = cycles per second (1 Hz. = 1 cycle/sec)

A 200 Mhz. clock has a cycle

time

time

seconds

program

cycles

program

seconds

cycle

1

200 106 109 5 nanoseconds

Page 16: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

20

Example

IClass IC CPI Mix

Load 766 2 9.7 %

Store 3538 2 45.11 %

Ubranch 182 3 2.32 %

Cbranch 947 4 12.1 %

Int Op 2409 1 30.77 %

Exec. Time = (CPIi * ICi)*T=

(766*2+3538*2+182*3+947*4+2409*1)*T=

=Total Ins. * (CPIi * Mixi)*T=

Page 17: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

21

Averaging

Program Exe. Time

P1 5 seconds

P2 10 seconds

P3 20 seconds

P4 3 seconds

Arithmetic Mean=(1/n) Exei=9.5

Page 18: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

22

Averaging

Weights Program Exe. Time

20 % P1 5 seconds

30 % P2 10 seconds

5 % P3 20 seconds

45 % P4 3 seconds

Arithmetic Mean = 0.2*5 + 0.3*10 + 0.05*20 + 0.45*3=

6.35

Page 19: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

23

Amdahl’s Law

• If you enhance an aspect of a machine

that improves a portion of the execution

time say by a factor n, how much will

be the overall improvement?

Execution time

Page 20: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

24

Amdahl’s Law (Cont’d)

• We have optimized the system so that

50 % of execution time is improved by

factor of 10. How much is the overall

speedup?

Page 21: Performance (metrics for measuring the performance of a …engold.ui.ac.ir/~m.rezaei/architecture/calendar/... · 2019-01-05 · 3 Two notions of “performance” ° Time to do the

25

MIPS

• Is Million Instructions Per Second Million Instructions Per Second a

good performance metric?

How many Instruction per second = IC/Exec.

… … …

code

10 s 10

billion

Ins

t.

MIPS = IC/(Exe. *106) =1/(IPC*T* 106)