Professional Documents
Culture Documents
03 Performence
03 Performence
CSE, KU
Confession
q Most of the materials have been collected from
Internet.
4
Atanu Shome, CSE KU
Which One is Better?
● Two computers run the same
program in 5 seconds and 7
seconds.
5
Atanu Shome, CSE KU
Terms
● Response Time / Execution Time:
○ Time between start to end of a task
● Throughput:
○ Total amount of work complete in a given time
6
Atanu Shome, CSE KU
Performance vs
Execution
7
Atanu Shome, CSE KU
Performance
8
Atanu Shome, CSE KU
Performance vs Execution
9
Atanu Shome, CSE KU
Question
● If computer X runs a program in 10 seconds and
computer Y runs the same program in 15 seconds,
how much faster is X than Y?
10
Atanu Shome, CSE KU
How Much Faster?
!"#$%#&'()"! *+"),-.%("
● !"#$%#&'()""
= *+"),-.%(!
!"#$%#&'()"! /0
● !"#$%#&'()""
= /1
= 1.5
11
Atanu Shome, CSE KU
● Measuring Performance
12
Atanu Shome, CSE KU
Terms
● Execution Time = Seconds per Program
Again
● Time(wall clock time, response time, or
elapsed time) = total time to complete
a task, including disk accesses,
memory accesses, input/output (I/O)
activities, operating system overhead—
everything.
13
Atanu Shome, CSE KU
CPU Time
● Multiple programs run at the same time
○ Throughput OR Less Execution Time
CPU Time
14
Atanu Shome, CSE KU
Clock Cycle
● Clock cycles (ticks, clock ticks, clock periods,
clocks, cycles)
○ Time for one clock period, usually of the
processor clock, which runs at a constant rate.
● Clock Period
● Clock Rate
15
Atanu Shome, CSE KU
Clock Cycle vs Clock Rate
1
𝐶𝑙𝑜𝑐𝑘 𝑅𝑎𝑡𝑒 =
𝐶𝑙𝑜𝑐𝑘 𝐶𝑦𝑐𝑙𝑒
16
Atanu Shome, CSE KU
CPU Execution Time Formula
17
Atanu Shome, CSE KU
Improving Performance ?
Our favourite program runs in 10
seconds on computer A, which has a 2
GHz clock. We are trying to help a
computer designer build a computer, B,
which 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 computer B to require 1.2 times
as many clock cycles as computer A for
this program. What clock rate should we
tell the designer to target?
18
Atanu Shome, CSE KU
Improving Performance ?
Our favourite program runs in 10
seconds on computer A, which has a 2
GHz clock. We are trying to help a
computer designer build a computer, B,
which 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 computer B to require 1.2 times
as many clock cycles as computer A for
this program. What clock rate should we
tell the designer to target?
19
Atanu Shome, CSE KU
Instruction Performance
20
Atanu Shome, CSE KU
CPI – Clock Cycle Per Instruction
● Average number of clock cycles per instruction for
a program or program fragment.
21
Atanu Shome, CSE KU
Problem
Suppose we have two implementations
of the same instruction set architecture.
Computer A has a clock cycle time of
250 ps and a CPI of 2.0 for some
program, and computer B has a clock
cycle time of 500 ps and a CPI of 1.2 for
the same program. Which computer is
faster for this program and by how
much?
22
Atanu Shome, CSE KU
Problem
Suppose we have two
implementations of the same
instruction set architecture.
Computer A has a clock cycle
time of 250 ps and a CPI of 2.0
for some program, and
computer B has a clock cycle
time of 500 ps and a CPI of 1.2
for the same program. Which
computer is faster for this
program and by how much?
23
Atanu Shome, CSE KU
24
Faster Faster
25
Atanu Shome, CSE KU
Faster Faster
26
Atanu Shome, CSE KU
Exercise from Book ?
27
Atanu Shome, CSE KU
Power Wall
28
Atanu Shome, CSE KU
OH! Noooooo
● Pitfall: Expecting the improvement of one aspect of
a computer to increase overall performance by an
amount proportional to the size of the improvement.
30
Atanu Shome, CSE KU
Amdahl’s Law
Suppose a program runs
in 100 seconds on a
computer, with multiply
operations responsible
for 80 seconds of this
time. How much do I
have to improve the
speed of multiplication if
I want my program to run
five times faster?
31
Atanu Shome, CSE KU
Thank You
Atanu Shome, CSE KU