0% found this document useful (0 votes)
31 views4 pages

Comp Org Notes On Measuring Cpu Performance

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

Comp Org Notes On Measuring Cpu Performance

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

COMP ORG NOTES ON MEASURING

CPU PERFORMANCE

What is Computer Performance??


 amount of work accomplished by a
computer system
 Refers to speed
 Refers to the time of the completion of a
program from start to finish
Performance Metrics
Time
Different ways in measuring time:
 Response Time – the time between the
start and the completion of a task
 Throughput – The total amount of work
done in a given time
 CPU Execution – Total time a CPU
spends computing on a given task
- excludes IO wait time
- Also known as CPU time

Computer Performance
Involves:
 Short response time
 High throughput (rate of processing
work)
 Low utilization of computing resource(s)
 High availability of the computing system
or application
 Fast (or highly compact) data Computer Performance
compression and decompression
 High bandwidth
 Short data transmission time

Performance Factors
 Latency: response time, execution time
o Good metrics for fixed amount of
work (minimize time)
 Throughput: bandwidth, work per time
o Good metrics for fixed amount of To related the performance between two
time (maximize work) computers
quantitatively:
CPU Performance Equation

Example 1: If computer Aruns a program in


Instruction Execution Rate 10 seconds and computer Bruns in 25
seconds, how much faster is A than B?

PerformanceA = Execution time B = n


PerformanceB Execution time A

=25/10 = 2.5

Computer A is 2.5 times faster than


computer B.
Computer Clock 10MHz and a CPI of 2.0. Computer B has
 It runs at constant rate a clock cycle time of 20ns and a CPI of
 Determines when events take place in 1.2. Which computer is faster and by how
hardware much?
 Clock cycle time –amount of time for one
clock period to elapse Assume that both computers run the
 Clock rate –inverse of clock cycle
 Example: If a computer has a clock rate
of 200MHz, its clock cycle time is:
clock cycle time = 1/clock rate = 0.000000005 or
5x10-9 or 5ns

Terms:
 Clock cycle time (seconds per cycle)
 Clock rate (cycles per second)
 CPI (cycles per instruction) same # of instructions in the program.

A given program contains: Processor Clock


 number of instructions
 number of clock cycles
 number of seconds

CPU Time
 Time for CPU to perform a task
 Does not include waiting time (for IO) or
other programs
 2 Divisions of CPU Time
1. User CPU Time–CPU time spent in Clock rate depends on the CPU Organization
the program design and the hardware implementation of
2. System CPU Time –CPU time spent VLSI
 A computer machine instruction is composed
in the OS performing task in
of micro operations.
behalf of the program
 Micro operation is a hardware operation
CPU Time Computation performed during one CPU clock cycle
 Time to execute a given program:  Examples: Register operations: shift, load,
o CPU time = CPU clock cycles x clock clear, increment
cycle time Operations: add, subtract, div,
since cycle time = 1/ clock rate mul
o CPU time = CPU clock cycles / clock
rate CPI Computation
 CPI –average number of cycles per
CPU Time instruction
 Each instruction type has it frequency
and number of cycles needed for its
execution
 To compute for CPI:
CPI = ∑ CPI x Frequency

Example:

Example:
1. What is the CPU time if the CPU clock
rate is 1MHz and the time to execute the
program is 45,000,000 cycle?
Example:
CPU time = CPU clock cycles / clock rate Given: Benchmark has 100 instructions where:
= 45,000,000 / 1,000,000 = 45 25 instructions are loads/stores (each
seconds take 2 cycles)
50 instructions are adds (each takes 1
cycle)
2. Assume that 2 computers use the same
25 instructions are square root (each
ISA. Computer A has a clock cycle rate of takes 50 cycles)
Formula:

What is the CPI for this benchmark?


Solution: MIPS (Million of Instructions Per
CPI = ((0.25 * 2) + (0.50 * 1) + (0.25 * 50)) Second)
= 13.5
- A performance measure

MIPS

Instruction Types and CPI

Where: CPU clock cycles = average clock cycles

CPU Instructions are divided into Instruction


Classes:
 Load and Store
 Computational
 Jump and Branch

Example: An instruction set has three instruction


classes

Two code sequences have the following


instruction counts:

Compute for the CPI of codes sequence 1


and 2.
Instruction Frequency and CPI

From Amdhal’s Law:


 The performance enhancement is
possible due to a given design
improvement and is limited by the
amount that the improved feature is
used.

For previous example B:


If a new compiler was used with 9,500,000
instruction count (instructions executed),
average CPI is 3.0, and clock rate is 300
MHz, what is the speedup with the changes?
(refer to previous slide).

PB/PB = TB/TA
TB = (9.5x106 x 3.0) / 300 x 106
TB = 0.095
TA (form problem A) = 0.125 seconds
MFLOP PB/PA = TA/TB = 0.125 / 0.095 = 1.32

MIPS RATING

 its rating is dependent on the program


 Based on operations in the program
 Not dependable since machines vary in
floating-point operations
 Floating—point operations have different
ratings (addition has higher rating than
division, since division is more complex)

Example Problems:

A. What is the execution time of a


program running on a machine with: Compute for the Execution time for both
a. 10,000,000 instructions (total compilers.
instructions executed)
b. cycles/instruction (average CPI
of the program)
c. 200 MHz (CPU clock rate)
B. If a new compiler was used with
9,500,000 instruction count
(instructions executed), average CPI
is 3.0, and clock rate is 300 MHz,
what is the speedup with the
changes?

You might also like