1 / 19

Measuring Performance

Measuring Performance. www.hndit.com. Outline. Why measure performance? Characterising performance Performance and speed Basic terminology for measuring Performance and Execution Time. Why Measure Performance?. SO THAT YOU KNOW WHAT YOU’RE SUPPOSED TO BE GETTING!. So that you can

lbetts
Télécharger la présentation

Measuring Performance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Measuring Performance www.hndit.com

  2. Outline • Why measure performance? • Characterising performance • Performance and speed • Basic terminology for measuring • Performance and Execution Time

  3. Why Measure Performance? SO THAT YOU KNOW WHAT YOU’RE SUPPOSED TO BE GETTING! So that you can compare systems! So that you can know if the machine can do its tasks.

  4. www.hndit.com Characterising Performance • Not always obvious how to characterise performance: • motor cars • football teams • tennis players • computers? • Can lead to serious errors • improve the processor to improve speed?

  5. www.hndit.com Performance and Speed • Performance for a program on a particular machine • X is n times faster than Y

  6. www.hndit.com Measuring Time • Execution time is the amount of time it takes the program to execute in seconds. • Time (computers do several tasks!) • elapsed time based on a normal clock; • CPU time is time spent executing this program • excluding waiting for I/O, or other programs

  7. Elapsed Time (real time) CPU time for this program I/O waiting & other programs user (direct) system (time in OS) www.hndit.com Execution Time Example (UNIX) 11.099u 8.659s 10:43.67 3.0% (user) (system) (elapsed) (seconds) (seconds) (min:secs) CPU time = 3.0% of elapsed time

  8. www.hndit.com Measuring Amounts • 1 bit • 8 bits = 1 byte • 1024bytes = 1 kilobyte = 1KByte = 1K = 210 • 1024KBytes = 1 megabyte = 1MB = 220 • 1024MB = 1 gigabyte = 1GB = 230 • 1024GB = 1 terrabyte = 240 • and on to infinity Aside - 1 decade ago my home computer had 32K memory. Today it has 32MB, and needs to be upgraded to at least 64MB!

  9. www.hndit.com Measuring Times • Duration • 1 second • 1/1000 second = 1 millisec = 1ms = 10-3 s • 1/1,000,000 s = 1 microsec = 10-6 s • 1/1,000,000,000s = 1 nanosec = 10-9 s • Frequency • 1 Herz = 1 cycle per second • 1 MHz = 1,000,000 cycles per sec • 100MHz = 100,000,000 cycles per sec.

  10. www.hndit.com Computer Clock Times • Computers run according to a clock that runs at a steady rate • The time interval is called a clock cycle (eg, 10ns). • The clock rate is the reciprocal of clock cycle - a frequency, how many cycles per sec (eg, 100MHz). • 10 ns = 1/100,000,000 (clock cycle), same as:- • 1/10ns = 100,000,000 = 100MHz (clock rate).

  11. Purchasing Decision • Computer A has a 100MHz processor • Computer B has a 300MHz processor • So, B is faster, right? • WRONG! • Now, let’s get it right…..

  12. www.hndit.com Measuring Performance • The only important question: “HOW FAST WILL MY PROGRAM RUN?” • CPU execution time for a program • = CPU clock cycles * cycle time • (= CPU clock cycles/Clock rate) • In computer design, trade-off between: • clock cycle time, and • number of cycles required for a program

  13. www.hndit.com Cycles Per Instruction • The execution time of a program clearly must depend on the number of instructions • but different instructions take different times • An expression that includes this is:- • CPU clock cycles = N * CPI • N = number of instructions • CPI = average clock cycles per instruction

  14. Machine A clock cycle time 10ns/cycle CPI = 2.0 for prog X Machine B clock cycle time 30ns/cycle CPI = 0.5 for prog X Let I = number of instructions in the program. CPU clock cycles (A) = I * 2.0 CPU time (A) = CPU clock cycles * clock cycle time = I * 2.0 * 10 = I * 20 ns CPU clock cycles (B) = I * 0.5 CPU time (B) = CPU clock cycles * clock cycle time = I * 0.5 * 30 = I * 15 ns www.hndit.com Example

  15. www.hndit.com Basic Performance Equation • CPU Time = I * CPI * T • I = number of instructions in program • CPI = average cycles per instruction • T = clock cycle time • CPU Time = I * CPI / R • R = 1/T the clock rate • T or R are usually published as performance measures for a processor • I requires special profiling software • CPI depends on many factors (including memory).

  16. www.hndit.com Other “tricks of the trade” • MIPS • Million Instructions Per Second • MFLOPS • Million Floating Point Operations Per Second • Benchmarks: SPECs • Average Performance over a set of example programs • Are any of these accurate? or even useful?

  17. Marketing Metrics (Patterson) www.hndit.com MIPS = Instruction Count / Time * 10^6 = Clock Rate / CPI * 10^6 • machines with different instruction sets ? • programs with different instruction mixes ? • dynamic frequency of instructions • uncorrelated with performance MFLOP/S = FP Operations / Time * 10^6 • machine dependent • often not where time is spent

  18. www.hndit.com Amdahl's Law Speedup due to enhancement E: ExTime w/o E Performance w/ E Speedup(E) = -------------------- = --------------------- ExTime w/ E Performance w/o E Suppose that enhancement E accelerates a fraction F of the task by a factor S and the remainder of the task is unaffected then, ExTime(with E) = ((1-F) + F/S) X ExTime(without E) Speedup(with E) = ExTime(without E) ÷ ((1-F) + F/S) X ExTime(without E)

  19. www.hndit.com Summary • Dealt with issues of measuring performance • Considered terminology for measuring performance • bits • bytes • megabytes • nanoseconds • MHz • Seen the basic formulae for execution time.

More Related