130 likes | 249 Views
CSCE 212 Chapter 4: Assessing and Understanding Performance. Instructor: Jason D. Bakos. Measuring Performance. Basic problem: how can we tell if one processor is faster than another? Execution time is analogous to performance Execution time (per processor core) =. Example.
E N D
CSCE 212Chapter 4: Assessing and Understanding Performance Instructor: Jason D. Bakos
Measuring Performance • Basic problem: how can we tell if one processor is faster than another? • Execution time is analogous to performance • Execution time (per processor core) =
Example • A program runs in 10 seconds on computer A, which has a 4 GHz clock. We are designing computer B that must run the program in 6 seconds. We can increase clock rate but the computer will require 1.2 times as many clock cycles. What clock rate should be target for computer B?
Performance Factors • Execution time = instructions per program * cycles per instruction * seconds per cycle • Problems: • Cycles per instruction depends on many factors • i.e. instruction mix, I/O, memory • Performance factors: • Algorithm instruction count, CPI • Programming language instruction count, CPI • Compiler instruction count, CPI • ISA instruction count, clock rate, CPI
Performance Measures • CPI = cycles per instruction • CPI provides one way of comparing two different implementations of the same instruction set architecture • CPI is tricky! • Instructions from the same ISA require different number of cycles • Depends on program • Memory behavior affects CPI • CPI is usually defined for a particular program on a particular CPU
Example • Suppose we have two implementations of the same ISA. Computer A has a 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 and by how much?
Performance Measures • Program execution time vs CPU execution time • Must account for other programs and 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.
Relative Performance • Solutions: • Total execution time • Arithmetic mean • Weight arithmetic mean (based on workload for each program)
MIPS • Instructions per second • MIPS is problematic • Does not take into account the capabilities of the instructions • MIPS varies between programs on the same computer! • Depends on average CPI of the instruction mix • MIPS can vary inversely with performance
Benchmarks • Set of programs that are used to evaluate a machine’s performance • SPEC CPU 2000 suite • 12 integer and 14 floating-point • Measured as speedup relative to Sun Ultra 5_10@300 MHz • CINT2000 and CFP2000 is geometric mean of ratios
Amdahl’s Law • Basic idea: improve the common case • Example: • Program runs in 100 s, multiplies accord for 80 s • I want a 5X overall speedup