0% found this document useful (0 votes)
3 views9 pages

Performance of Processor1

The document discusses CPU performance measurement, focusing on execution time, cycles per instruction (CPI), and clock rates. It includes examples illustrating how to compare the performance of different processors and calculate CPU time based on instruction counts and CPI. Additionally, it introduces MIPS and MFLOPS as metrics for measuring instruction and floating-point operation performance, respectively.

Uploaded by

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

Performance of Processor1

The document discusses CPU performance measurement, focusing on execution time, cycles per instruction (CPI), and clock rates. It includes examples illustrating how to compare the performance of different processors and calculate CPU time based on instruction counts and CPI. Additionally, it introduces MIPS and MFLOPS as metrics for measuring instruction and floating-point operation performance, respectively.

Uploaded by

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

CPU

Performance
• Basic problem: how can we tell if one processor is faster than
another?

• Execution time is analogous to


performance
PerformanceX Execution TimeY 

n
PerformanceY Execution
Time
• Execution time (perX processor
core) = CPU execution time CPU clock cycles
  Clock cycle
for a program for a program time

CPU execution time CPU clock cycles for a program



for a program Clock rate
Performance
Measures
• CPI = cycles per instruction
– CPI provides one way of comparing two different
implementations of the same instruction set
architecture

– CPI is usually defined for a particular program on a


particular CPU
CPU time  Instruction count  CPI  Clock cycle time

Instruction count  CPI


CPU time 
Clock rate
Ex 1:
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?

Solution:

The performance ratio is 15/10 = 1.5


so A is 1.5 times faster than B.

Ex 2:
A program runs on computer A with a 2 GHz clock in 10 seconds. What
clock rate must a computer B has to run this program in 6 seconds?
Unfortunately, to accomplish this, computer B will require 1.2 times as
many clock cycles as computer A to run the program.
Solution:
We denote x as clock cycle # on computer A, y as clock rate on computer
B.
x = 10 × 2 × 109 , 1.2x = 6 × y. → y = 4 × 109 = 4 GHz.
Ex 3:

CPU clock rate is 1 MHz ‰ .Program takes 45 million cycles to execute ‰.


What’s the CPU time?
Solution:
45,000,000 * (1 / 1,000,000) = 45 seconds

Ex 4:
Suppose a program has the following
25% instructions are loads/stores (each take 2 cycles)
50% instructions are adds (each takes 1 cycle)
25% instructions are square root (each takes 50 cycles)
What is the CPI for this benchmark?

Solution:
CPI = ((0.25 * 2) + (0.50 * 1) + (0.25 * 50)) = 13.5
Ex 5:

Computers A and B implement the same ISA. Computer A has a clock cycle
time of 250 ps and an effective CPI of 2.0 for some program and computer
B has a clock cycle time of 500 ps and an effective CPI of 1.2 for the same
program. Which computer is faster and by how much?
Solution:
Assume each computer executes I instructions, so
CPU timeA = I × 2.0 × 250 = 500 × I ps
CPU timeB = I × 1.2 × 500 = 600 × I ps

A is faster by the ratio of execution times:


performanceA / performanceB = execution timeB / execution timeA
= 600 × I / 500 × I
= 1.2
Ex 6:

•Suppose one machine, A, executes a program with an average


CPI of 2.1.
•Suppose another machine, B (with the same instruction set and
an enhanced compiler), executes the same program with 25%
less instructions and with a CPI of 1.8 at 800MHz.
•In order for the two machines to have the same performance,
what does the clock rate of the first machine (machine A) need
to be?
Solution:

• instructionsA * CPIA * (1/clockrateA) =


instructionsB * CPIB * (1/clockrateB)

• instructionsA * 2.1 * (1/clockrateA) =


0.75*instructionsA * 1.8 * (1/800x106)

• 2.1 * (1/clockrateA) = 0.75*1.8 * (1/800x10 6)

• clockrateA = 1.2444GHz
Ex 7:

Suppose a program has the following instruction classes, CPIs,

and mixtures: Instruction type CPI ratio


A 1.4 55%
B 2.4 15%
C 2.0 30%

Your CPU design engineers give you the


following options:
Option A: Reduce the CPI of instruction type A to
1.1

(.55)*1.1 + (.15)*2.4 + (.30)*2 = 1.565

Option B: Reduce the CPI of instruction type B to

1.2 (.55)*1.4 + (.15)*1.2 + (.30)*2 = 1.55

Which option would you choose and why?


MIPS and MFLOPS

MIPS : millions of instructions per second


‰ MIPS = instruction count / (execution time x 10 6 )
‰ For example, a program that executes 3 million instructions in 2
seconds has a MIPS rating of 1.5

MFLOPS : millions of floating point operations per second


„ MFLOPS = floating point operations / (execution time x 106)
„ For example, a program that executes 4 million fp. instructions in 5
seconds has a MFLOPS rating of 0.8

You might also like