Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos.

Similar presentations


Presentation on theme: "Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos."— Presentation transcript:

1 Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos

2 Fall 2001CS 4472 Introduction Performance measures are important Factors that contribute to performance –Instruction utilization in software –How well the hardware implements the instructions –How well the memory and I/O system perform What are the best metrics to use for determining performance?

3 Fall 2001CS 4473 Defining Performance How do we define performance? –response (or execution) time the time between the start and the finish of a task –throughput total amount of work done in a given time –Almost just an inverse relationship, but throughput can be increased with parallelism

4 Fall 2001CS 4474 Execution Time For now, we are only concerned with execution Time For two machines, X and Y…

5 Fall 2001CS 4475 Execution Time If X is n times faster than Y…

6 Fall 2001CS 4476 Execution Time Execution time is measured in seconds Program execution time – “wall-clock time” to execute a program CPU execution time – amount of time the CPU spends executing a program (on a time-shared system) –Extra time passes while other programs are being executed –Extra time passes while a program waits for I/O User CPU time – CPU time spent executing a program System CPU time – amount of CPU time the operating system spends on behalf of a program –Ex. system calls, such as I/O, synchronization, etc.

7 Fall 2001CS 4477 More Terminology System performance – elapsed time on an unloaded system CPU performance – CPU time

8 Fall 2001CS 4478 Clock Cycles CPUs use a clock to synchronize events that occur in hardware –Events occur on the rising or falling edge of the clock signal –The clock is a global signal –Has a discrete time intervals called clock cycles Has cycle time or clock rate (inverses) –Ex. 500MHz or 2 ns This is the PERIOD of the clock (compare to duty cycle)

9 Fall 2001CS 4479 Relating the Metrics This is why a CPU clock rate doesn’t give a direct indication of CPU performance…

10 Fall 2001CS 44710 Example Our favorite program runs in 10 seconds on computer A, which has a 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 tell the designer to target?

11 Fall 2001CS 44711 Cycles per Instruction CPI = cycles per instruction –Average number of clock cycles to execute an instruction –For each architecture, different instructions take different amounts of clock cycles to execute –CPI provides one way of comparing two different implementations of the same instruction set architecture This is because in this case, the instruction count for any given program will be the same

12 Fall 2001CS 44712 Basic Peformance Equation (Revisited) Three key factors that affect performance –Instruction count –CPI –Clock cycle time

13 Fall 2001CS 44713 Considerations We get CPU execution time from running a program The clock cycle time is published Instruction count and CPI are more difficult to get –Why is it difficult to get the instruction count? Some processors actually keep track of this –CPI depends on I/O and memory system –We only need one of these

14 Fall 2001CS 44714 More Considerations Use this equation when there are different classes of instructions that require different numbers of clock cycles

15 Fall 2001CS 44715 Benchmarks Benchmarks are a set of programs that are used to evaluate a machine’s performance –Ex. SPEC95 int/fp benchmarks –Processor companies may target the hot code segments in the benchmarks for optimization in order to make their product look better

16 Fall 2001CS 44716 Amdahl’s Law for Improving Performance Suppose a program runs in 100 seconds on a machine, 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? Answer? Cannot be done! Amdahl’s Law dictates that we should make the common case fast… The opportunity for improvement is affected by how much time the event occurs

17 Fall 2001CS 44717 MIPS There are 3 problems with using MIPS as a measure for comparing machines –MIPS specifies the instruction execution rate but does not take into account the capabilities of the instructions Affects instruction count –MIPS varies between programs on the same computer! Depends on average CPI of the instruction mix –MIPS can vary inversely with performance! This occurs when CPI is higher on a machine with a higher MIPS


Download ppt "Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos."

Similar presentations


Ads by Google