300 likes | 472 Views
Computing Systems. Assessing and Understanding Performance. Performance. Measure, Report, and Summarize performance Make intelligent choices See through the marketing hype
E N D
Computing Systems Assessing and Understanding Performance claudio.talarico@mail.ewu.edu
Performance • Measure, Report, and Summarize performance • Make intelligent choices • See through the marketing hype • Key to understanding underlying organizational motivationWhy is some hardware better than others for different programs?What factors of system performance are hardware related?(e.g., Do we need a new machine, or a new operating system?)How does the machine's instruction set affect performance? • We are looking for metrics for measuring performance from the viewpoint of both a computer user and a designer claudio.talarico@mail.ewu.edu
Defining performance • How much faster is the Concorde compared to the 747 ? • Is the Concorde faster compared to the 747 ? • How much bigger is the 747 than the Douglas DC-8? • Which of these airplanes has the best performance ? claudio.talarico@mail.ewu.edu
Understanding performance • The performance of a program depends on: • the algorithm, • the language, • the compiler, • the architecture • the actual hardware claudio.talarico@mail.ewu.edu
Computer performance: Time, Time, Time !!! • Response Time = Execution Time = Latency - The time between the start and completion of a task • Throughput - Total amount of work completed in a given time If we upgrade a machine with a new faster processor whatdo we increase? If we add a new processorto a system that uses multiple processors what do we increase? claudio.talarico@mail.ewu.edu
Execution Time • Execution Time (response time or elapsed time) • total time to complete a program, it counts everything (disk accesses, memory accesses, input/output activities) • a useful number, but often not good for comparison purposes • CPU (execution) time • doesn't count time spent waiting for I/O or time spent running other programs • can be broken up into systemtime (CPU time spent in the OS), and usertime (CPU time spent in the program) • Our focus:user CPU time • time spent executing the lines of code that are "in" our program claudio.talarico@mail.ewu.edu
Book’s definition of performance - For some program running on machine X, - "X is n times faster than Y" • Problem (Relative Performance) : • machine A runs a program in 10 seconds • machine B runs the same program in 25 seconds • How much faster is machine A compared to B ? claudio.talarico@mail.ewu.edu
time Measuring Time • Instead of reporting execution time in seconds, we often usecycles (= clock cycles = ticks = clock ticks = clocks = clock periods) • Clock “ticks” indicate when to start activities: • cycle time = time between ticks = seconds per cycle • clock rate (frequency) = cycles per second (1 Hz. = 1 cycle/sec)Example: a 4 GHz. clock has a 250 ps. cycle time claudio.talarico@mail.ewu.edu
How to improve performance • So, to improve performance (everything else being equal) you can either (increase or decrease?)________ the # of required cycles for a program, or________ the clock cycle time or, said another way, ________ the clock rate. claudio.talarico@mail.ewu.edu
Example - improving performance Our favorite program runs in 10 seconds on computer A,which has a 4 GHz. clock. We are trying to help a computer designer build a new machine B, that will run this program in 6 seconds. The designer can use new (or perhaps more expensive) technology to substantially increase the clock rate, but has informed us that 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 the same program. What clock rate should we tell the designer to target?" claudio.talarico@mail.ewu.edu
Cycles required for a program • Can we assume that # cycles = # instructions ? • This assumption is incorrect. Different instructions take different amounts of time. Why? • remember that these are machine instructions, not lines of C code • Multiplication takes more time than addition • Floating point operations take longer than integer ones • Accessing memory takes more time than accessing registers Important point: changing the cycle time often changes the numberof cycles required for various instructions (more later) claudio.talarico@mail.ewu.edu
Clock cycles per instruction • It is clear that the execution time of a program must depends on the number of machine instructions generated by the compiler: • the average number of clock cycles each instruction takes to execute is often abbreviated CPI • CPI provides a way of comparing two different implementations of the same ISA (since the IC required for a program will be the same) claudio.talarico@mail.ewu.edu
The “performance equation” • A given program will require: • some number of instructions (machine instructions) • some number of cycles per each instruction • some number of seconds per cycle • This useful formula separate the 3 key factors that affect performance. claudio.talarico@mail.ewu.edu
Performance - the BIG picture • The only complete and reliable measure of performance is determined by execution time • Do any of the other variables equal performance?NO! • # of cycles to execute program? • # of instructions in program? • # of cycles per second? • average # of cycles per instruction (CPI)? • average # of instructions per second (MIPS)? • Common pitfall: thinking one of the variables is indicative of performance when it really isn’t. claudio.talarico@mail.ewu.edu
Example - CPI • Suppose we have two implementations of thesameinstruction set architecture (ISA). For some program: • Machine A has a clock cycle time of 250 ps and a CPI of 2.0 • Machine B has a clock cycle time of 500 ps and a CPI of 1.2 • What machine is faster for this program, andby how much? • If two machines have the same ISA which of the following quantities will always be identical? • clock rate, • CPI, • execution time, • # of instructions, • # of cycles, • MIPS claudio.talarico@mail.ewu.edu
Example - Number of Instructions A compiler designer is trying to decide between two codesequences for a particular machine. Based on the hardwareimplementation, there are three different classes of instructions: Class A, Class B, and Class C, and they require one, two, and three cycles(respectively). The first code sequence has 5 instructions: 2 of A, 1 of B, and 2 of C. The second sequence has 6 instructions: 4 of A, 1 of B, and 1 of C. Which sequence will be faster? How much? What is the average CPI for each sequence? Hint: N = number of instruction classes, Ci = count of the # of instructions of class i executed claudio.talarico@mail.ewu.edu
MIPS • Million instructions per second • Problems using MIPS for comparing computers • MIPS specifies the instruction execution rate but does not take into account that instructions may have different capabilities • MIPS varies between programs on the same computer; thus a computer cannot have a single MIPS rating for all programs • MIPS can vary inversely with performance !!! claudio.talarico@mail.ewu.edu
Example – MIPS • Two different compilers are being tested for a 4 GHz. machine with three different classes of instructions: Class A, Class B, and Class C, which require one, two, and three cycles(respectively). Both compilers are used to produce code for a large piece of software.The first compiler's code uses:- 5 million Class A instructions, - 1 million Class B instructions, - 1 million Class C instructions.The second compiler's code uses:- 10 million Class Ainstructions, - 1 million Class B instructions, - 1 million Class C instructions. • Which sequence will be faster according to MIPS? • Which sequence will be faster according to execution time? claudio.talarico@mail.ewu.edu
Benchmarks Performance best determined by running a real application • Use programs typical of expected workload • or typical of expected class of applications(e.g., compilers/editors, scientific applications, graphics, etc.) Small benchmarks • nice for architects and designers • easy to standardize • can be abused SPEC (System Performance Evaluation Cooperative) • companies have agreed on a set of real program and inputs • valuable indicator of performance (and compiler technology) • can still be abused (see Intel’s benchmark ) claudio.talarico@mail.ewu.edu
Benchmark “games” • An embarrassed Intel Corp. acknowledged Friday that a bug in a software program known as a compiler had led the company to overstate the speed of its microprocessor chips on an industry benchmark by 10 percent. However, industry analysts said the coding error…was a sad commentary on a common industry practice of “cheating” on standardized performance tests…The error was pointed out to Intel two days ago by a competitor, Motorola …came in a test known as SPECint92…Intel acknowledged that it had “optimized” its compiler to improve its test scores. The company had also said that it did not like the practice but felt to compelled to make the optimizations because its competitors were doing the same thing…At the heart of Intel’s problem is the practice of “tuning” compiler programs to recognize certain computing problems in the test and then substituting special handwritten pieces of code… Saturday, January 6, 1996 New York Times claudio.talarico@mail.ewu.edu
Benchmarks • Different classes and applications of computers requires different types of benchmark suites • SPEC CPU2000 • SPECweb99 • EEMBC • The execution time measurements are normalized by dividing the execution time on a Sun Ultra 5_10 with a 300 MHz processor by the execution time on a measured computer (this measure is called SPEC ratio) • The guiding principle in reporting performance measurements should be reproducibility (an important aspect of reproducibility is the choice of input) claudio.talarico@mail.ewu.edu
Spec’89 – Compiler enhancement and performance claudio.talarico@mail.ewu.edu
SPEC CPU2000 claudio.talarico@mail.ewu.edu
SPEC2000 Does doubling the clock rate double theperformance? claudio.talarico@mail.ewu.edu
SPEC2000 Can a machine with a slower clock rate have betterperformance? claudio.talarico@mail.ewu.edu
Performance, power, and energy efficiency • Power is increasingly becoming a key limitation in processor performance (especially for embedded processors) • In CMOS technology the primary source of power dissipation is: • For power limited application, the most important metric is energy efficiency, which is computed by taking performance and dividing by average power consumption when running the benchmark claudio.talarico@mail.ewu.edu
Summarizing performance • Although summarizing measurements result in less information, marketers and even users often prefer to have a single number to compare performance • Arithmetic mean of the execution times (underlying assumption that the programs in the workload are each run an equal number of times) • Weighted arithmetic mean (wi frequency of the program in the workload) claudio.talarico@mail.ewu.edu
Amdahl’s law • The performance enhancement possible with a given improvement is limited by the amount that the improved feature is used • Principle: make the common case fast Execution time after improvement = Execution time affected + Execution time unaffected Amount of improvement claudio.talarico@mail.ewu.edu
Example – Amdahl’s law Suppose a program runs in 100 seconds on a machine,with multiply responsible for 80 seconds of this time. How much do we have to improve the speed of multiplication if we want the program to run 4 times faster? How about making it 5 times faster? claudio.talarico@mail.ewu.edu
Summary Performance is specific to a particular program • Execution time is the only valid and unimpeachable measure of performance For a given ISA, increases in CPU performance come from three sources • Increases in clock rate • Improvement in processor organization that lower the CPI • Compiler enhancements that lower the instruction count and/or the average CPI (e.g. by using simpler instructions) Pitfalls • Using a subset of the “performance equation” as performance metric • Expecting the improvement of one aspect of a machine’s performance to increase total performance by an amount proportional to the size of the partial improvement • Designing only for performance without considering cost, functionality and other requirements is unrealistic claudio.talarico@mail.ewu.edu