0% found this document useful (0 votes)
28 views37 pages

Lecture 4

The document discusses the importance of measuring CPU performance in computer architecture, highlighting the challenges and methods for accurate assessment. It explains key performance metrics such as response time and throughput, and how they differ for desktop users versus data centers. Additionally, it introduces performance equations that incorporate execution time, instruction count, and clock cycles to evaluate and compare computer systems.

Uploaded by

Asma Ayub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views37 pages

Lecture 4

The document discusses the importance of measuring CPU performance in computer architecture, highlighting the challenges and methods for accurate assessment. It explains key performance metrics such as response time and throughput, and how they differ for desktop users versus data centers. Additionally, it introduces performance equations that incorporate execution time, instruction count, and clock cycles to evaluate and compare computer systems.

Uploaded by

Asma Ayub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Advanced

Computer Architecture

CPU Performance
Measurement
Why we need performance?
 Hardware performance is key to the effectiveness of
entire system of hardware and software
 Accessing the performance can be quite challenging

But Still very important


 Accurately measuring and comparing different

computers is critical to purchasers and to designers


 We need to understand what determines the

performance of computers
Performance Measure: e.g.
Plane Passenger Cruising Cruising Passenger
Capacity range Speed throughput
(miles) (m.p.h) (passengers x
m.p.h)
Boeing 777
Boeing 747
Sud
Concorde
Douglas DC-
8
Performance Measure: e.g.
Plane Passenger Cruising Cruising Passenger
Capacity range Speed throughput
(miles) (m.p.h) (passengers x
m.p.h)
Boeing 777 375
Boeing 747 470
Sud 132
Concorde
Douglas DC- 146
8
Performance Measure: e.g.
Plane Passenger Cruising Cruising Passenger
Capacity range Speed throughput
(miles) (m.p.h) (passengers x
m.p.h)
Boeing 777 375 4630
Boeing 747 470 4150
Sud 132 4000
Concorde
Douglas DC- 146 8720
8
Performance Measure: e.g.
Plane Passenger Cruising Cruising Passenger
Capacity range Speed throughput
(miles) (m.p.h) (passengers x
m.p.h)
Boeing 777 375 4630 610
Boeing 747 470 4150 610
Sud 132 4000 1350
Concorde
Douglas DC- 146 8720 544
8
Performance Measure: e.g.
Plane Passenger Cruising Cruising Passenger
Capacity range Speed throughput
(miles) (m.p.h) (passengers x
m.p.h)
Boeing 777 375 4630 610 228750
Boeing 747 470 4150 610 286700
Sud 132 4000 1350 178200
Concorde
Douglas DC- 146 8720 544 79424
8
Measuring Performance: computers…..
 Response Time vs. throughput

◦ Response time or Execution time is stated as “The time


between the start of a process and its completion”.

◦ Throughput or Bandwidth is stated as “It is the amount


of work done per unit time”.
Measuring Performance: computers…..
 Desktop Users
◦ If you were running a program on two different desktop
computers, you’d say that the faster one is the desktop
computer that gets the job done first
 Data Centers
◦ If you are running a datacenter that had several servers
running jobs submitted by many users, you’d say that the
faster computer was the one that completed the most jobs
during a day.
 As an individual computer user, you are interested in
reducing response time
 Datacenter managers are often interested in increasing
throughput or bandwidth
Measuring Performance: computers…..
 In most cases, we will need different performance
metrics as well as different sets of applications to
benchmark embedded and desktop computers,
which are more focused on response time, versus
servers, which are more focused on throughput.
Measuring Performance
 Performance = 1 .
Execution time
This means that for two computers X and Y, if the
performance of X is greater than the performance of Y, we
have
Performance > Performance
X Y

1 . > 1 .
Execution timeX Execution timeY

Execution timeY > Execution timeX


Measuring Performance:

If X is n times faster than Y, then the execution time on Y is


n times longer than it is on X:
Measuring Performance

Or consequently, if the performance of 2 machines need


to be compared, then the above formula becomes…

PerformanceA = Execution timeB = n


PerformanceB Execution timeA
Measuring Performance
 Example:
◦ If computer A runs a program in 10 seconds and computer B
runs the same program in 15 seconds, how much faster is A
than B?
Measuring Performance
 Example(Solution): We know that A is n times faster than B if
Measuring Performance (contd.)
 Time: It is the measurement of computer performance
 The computer that performs the same amount of work in the
least time is the fastest.
 Program execution time is measured in seconds per program.
 Time can be defined in different ways, depending on what
we count.
 The most straightforward definition of time is called wall
clock time, response time, or elapsed time. These terms
mean the total time to complete a task, including disk
accesses, memory accesses, input/output (I/O) activities,
operating system overhead—everything.
Measuring Performance (contd.)
 Computers are often shared and a processor may work on
several programs simultaneously. In such cases, the system
may try to optimize throughput rather than attempt to
minimize the response time for one program. Hence, we
often want to distinguish between the response time and the
time that the processor is working on our behalf.
 CPU execution time or simply CPU time is the time the CPU
spends computing for specific task and does not include time
spent waiting for I/O or running other programs.
 Remember response time experienced by the user will be the
elapsed time of the program, not the CPU time.
Measuring Performance (contd.)
 CPU time can be further divided into
◦ user CPU time
◦ system CPU time
 CPU time spent in the program is called user CPU time
 CPU time spent in the operating system performing
tasks on behalf of the program, called system CPU time
 Elapsed time which is over all time taken for
performing tasks will be referred to system
performance.
Measuring Performance (contd.)
 All computers are constructed using a clock that
determines when events take place in the hardware.
These discrete time intervals are called clock cycles (or
ticks, clock ticks, clock periods, clocks, cycles)
 CPU time or CPU execution time based on:

1. Clock time
2. Number of clocks taken
Measuring Performance (contd.)
Let us denote:
 The number of CPU clock cycles taken to execute a job by ‘CC’ (cycle count)
 The cycle time by ‘CT’

Alternatively, because clock rate and clock cycle time are inverses,
Example:
 A program runs in 10 seconds on a 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 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?
Solution???
Instruction Performance
 The performance equations above did not include any
reference to the number of instructions needed for the
program
 since the compiler clearly generated instructions to
execute and the computer had to execute the instructions
to run the program, the execution time must depend on
the number of instructions in a program.
 In this way we can say that execution time is equals to
the number of instructions executed multiplied by the
average time per instruction
Instruction Performance
• Therefore, the number of clock cycles required for a
program can be written as

•The term clock cycles per instruction, which is the average


number of clock cycles each instruction takes to execute, is
often abbreviated as CPI
• Different instructions may take different amounts of time
depending on what they do, CPI is an average of all the
instructions executed in the program.
Instruction Performance
Instruction Performance
Instruction Performance
Example
Example
Example:
 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?
Solution???
CPU Performance Equation
 We can now write this basic performance equation in
terms of instruction count, CPI and clock cycle time:

or, since the clock rate is the inverse of clock cycle


time:

We can use these formulas to compare two different


implementations or to evaluate a design alternative if we know
its impact on these parameters.
Example:
Solution???

You might also like