Lecture 2a: Performance Measurement. Goals of Performance Analysis The goal of performance analysis is to provide quantitative information about the performance.

Slides:



Advertisements
Similar presentations
CS1104: Computer Organisation School of Computing National University of Singapore.
Advertisements

TU/e Processor Design 5Z032 1 Processor Design 5Z032 The role of Performance Henk Corporaal Eindhoven University of Technology 2009.
Evaluating Performance
SE-292 High Performance Computing Profiling and Performance R. Govindarajan
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1 Lecture 6 Performance Measurement and Improvement.
Chapter 4 Assessing and Understanding Performance Bo Cheng.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Time Measurement October 25, 2001 Topics Time scales Interval counting Cycle counters K-best measurement scheme class18.ppt.
Introduction to Operating Systems What is an operating system? Examples How do many programs run at the same time, with one processor?
Copyright © 1998 Wanda Kunkle Computer Organization 1 Chapter 2.1 Introduction.
Measuring Performance Chapter 12 CSE807. Performance Measurement To assist in guaranteeing Service Level Agreements For capacity planning For troubleshooting.
1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 22 Performance of Computer Systems.
Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos.
Copyright 2004 David J. Lilja1 Measuring Computer Performance: A Practitioner’s Guide David J. Lilja Electrical and Computer Engineering University of.
1 Lecture 10: FP, Performance Metrics Today’s topics:  IEEE 754 representations  FP arithmetic  Evaluating a system Reminder: assignment 4 due in a.
1 Measuring Performance Chris Clack B261 Systems Architecture.
Copyright 2004 David J. Lilja1 Measurement tools and techniques Fundamental strategies Interval timers Program profiling Tracing Indirect measurement.
Computer Organization and Design Performance Montek Singh Mon, April 4, 2011 Lecture 13.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Lecture 2b: Performance Metrics. Performance Metrics Measurable characteristics of a computer system: Count of an event Duration of a time interval Size.
1 CHAPTER 2 THE ROLE OF PERFORMANCE. 2 Performance Measure, Report, and Summarize Make intelligent choices Why is some hardware better than others for.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Lecture 2: Performance Measurement
Performance Chapter 4 P&H. Introduction How does one measure report and summarise performance? Complexity of modern systems make it very more difficult.
CDA 3101 Fall 2013 Introduction to Computer Organization Computer Performance 28 August 2013.
10/19/2015Erkay Savas1 Performance Computer Architecture – CS401 Erkay Savas Sabanci University.
1 CS/EE 362 Hardware Fundamentals Lecture 9 (Chapter 2: Hennessy and Patterson) Winter Quarter 1998 Chris Myers.
Performance.
Time Management.  Time management is concerned with OS facilities and services which measure real time, and is essential to the operation of timesharing.
CEN 316 Computer Organization and Design Assessing and Understanding Performance Mansour AL Zuair.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
Lecture 2d: Performance Comparison. Quality of Measurement Characteristics of a measurement tool (timer) Accuracy: Absolute difference of a measured value.
Chapter 3 System Performance and Models Introduction A system is the part of the real world under study. Composed of a set of entities interacting.
Morgan Kaufmann Publishers
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
4P13 Week 2 & 3 Talking Points 1. Kernel Processes 2.
1  1998 Morgan Kaufmann Publishers How to measure, report, and summarize performance (suorituskyky, tehokkuus)? What factors determine the performance.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Computer Organization Instruction Set Architecture (ISA) Instruction Set Architecture (ISA), or simply Architecture, of a computer is the.
Lecture 5: 9/10/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Chapter 4. Measure, Report, and Summarize Make intelligent choices See through the marketing hype Understanding underlying organizational aspects Why.
Lec2.1 Computer Architecture Chapter 2 The Role of Performance.
Operating Systems CPU Scheduling Algorithms
L12 – Performance 1 Comp 411 Computer Performance He said, to speed things up we need to squeeze the clock Study
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
EGRE 426 Computer Organization and Design Chapter 4.
Operating Systems. Categories of Software System Software –Operating Systems (OS) –Language Translators –Utility Programs Application Software.
Performance Computer Organization II 1 Computer Science Dept Va Tech January 2009 © McQuain & Ribbens Defining Performance Which airplane has.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Introduction to Performance Tuning Chia-heng Tu PAS Lab Summer Workshop 2009 June 30,
CSE 340 Computer Architecture Summer 2016 Understanding Performance.
Measuring Performance Based on slides by Henri Casanova.
OPERATING SYSTEMS CS 3502 Fall 2017
Operating System Overview
Defining Performance Which airplane has the best performance?
The deadline establish a priority among interrupt requests.
Lecture 2d1: Quality of Measurements
CS2100 Computer Organisation
Chapter 6: CPU Scheduling
Defining Performance Section /14/2018 9:52 PM.
Operating Systems.
Performance.
Computer Organization and Design Chapter 4
CS2100 Computer Organisation
Presentation transcript:

Lecture 2a: Performance Measurement

Goals of Performance Analysis The goal of performance analysis is to provide quantitative information about the performance of a computer system

Goals of Performance Analysis Compare alternatives When purchasing a new computer system, to provide quantitative information Determine the impact of a feature In designing a new system or upgrading, to provide before-and-after comparison System tuning To find the best parameters that produce the best overall performance Identify relative performance To quantify the performance relative to previous generations Performance debugging To identify the performance problems and correct them Set expectations To determine the expected capabilities of the next generation

Performance Evaluation Performance Evaluation steps: 1.Measurement / Prediction What to measure? How to measure? Modeling for prediction Simulation Analytical Modeling 2.Analysis & Reporting Performance metrics

Performance Measurement Interval Timers Hardware Timers Software Timers

Performance Measurement Hardware Timers Counter value is read from a memory location Time is calculated as ClockCounter TcTc n bits to processor memory bus Time = ( x 2 - x 1 ) x T c

Performance Measurement Software Timers Interrupt-based When interrupt occurs, interrupt-service routine increments the timer value which is read by a program Time is calculated as Clock Prescaling Counter TcTc to processor interrupt input T’ c Time = ( x 2 - x 1 ) x T’ c

Performance Measurement Timer Rollover Occurs when an n-bit counter undergoes a transition from its maximum value 2 n – 1 to zero There is a trade-off between roll over time and accuracy T’ c 32-bit64-bit 10 ns42 s5850 years 1  s 1.2 hour0.5 million years 1 ms49 days0.5 x 10 9 years

Timers Solution: 1.Use 64-bit integer (over half a million year) 2.Timer returns two values: One represents seconds One represents microseconds since the last second With 32-bit, the roll over is over 100 years

Performance Measurement Interval Timers T0  Read current time Event being timed (); T1  Read current time Time for the event is: T1-T0

Performance Measurement Timer Overhead Initiate read_time Current time is read Event begins Event ends; Initiate read_time Current time is read T1T1 T2T2 T3T3 T4T4 Measured time: T m = T 2 + T 3 + T 4 Desired measurement: T e = T m – (T 2 + T 4 ) = T m – (T 1 + T 2 ) since T 1 = T 4 Timer overhead: T ovhd = T 1 + T 2 T e should be times greater than T ovhd.

Performance Measurement Timer Resolution Resolution is the smallest change that can be detected by an interval timer. nT’ c < T e < (n+1)T’ c If T’ c is large relative to the event being measured, it may be impossible to measure the duration of the event.

Performance Measurement Measuring Short Intervals T e < T’ c T’ c TeTe TeTe  1  0

Performance Measurement Measuring Short Intervals Solution: Repeat measurements n times. Approximates a binomial distribution. Average execution time: T’ e = (m/n) x T’ c m: number of 1s measured T’ c TeTe

Performance Measurement Measuring Short Intervals Solution: Repeat measurements n times. Measure the total execution time (T t ) Average execution time: T’ e = (T t / n ) – h T t : total execution time of n repetitions h: repetition overhead T’ c TeTe TtTt

Performance Measurement Time Elapsed time / wall-clock time / response time Latency to complete a task, including disk access, memory access, I/O, operating system overhead, and everything (includes time consumed by other programs in a time-sharing system) CPU time The time CPU is computing, not including I/O time or waiting time User time / user CPU time CPU time spent in the program System time / system CPU time CPU time spent in the operating system performing tasks requested by the program

Performance Measurement UNIX time command 90.7u 12.9s 2:39 65% Drawbacks: Resolution is in milliseconds Different sections of the code can not be timed User time System time Elapsed time Percentage of elapsed time

Timers Timer is a function, subroutine or program that can be used to return the amount of time spent in a section of code. t0 = timer(); … … t1 = timer(); time = t1 – t0; zero = 0.0; t0 = timer(&zero); … … t1 = timer(&t0); time = t1;

Timers Read: Wadleigh, Crawford pg for: time, clock, gettimeofday, etc.

Timers Measuring Timer Resolution main() {... zero = 0.0; t0 = timer(&zero); t1 = 0.0; j=0; while (t1 == 0.0) { j++; zero=0.0; t0 = timer(&zero); foo(j); t1 = timer(&t0); } printf (“It took %d iterations for a nonzero time\n”, j); if (j==1) printf (“timer resolution <= %13.7f seconds\n”, t1); else printf (“timer resolution is %13.7f seconds\n”, t1); } foo(n){... i=0; for (k=0; k<n; k++) i++; return(i); }

Timers Measuring Timer Resolution Using clock() : Using times() : Using getrusage() : It took 682 iterations for a nonzero time timer resolution is seconds It took 720 iterations for a nonzero time timer resolution is seconds It took 7374 iterations for a nonzero time timer resolution is seconds

Timers Spin Loops For codes that take less time to run than the resolution of the timer First call to a function may require an inordinate amount of time. Therefore the minimum of all times may be desired. main() {... zero = 0.0; t2 = ; for (j=0; j<n; j++) { t0 = timer(&zero); foo(j); t1 = timer(&t0); t2 = min(t2, t1); } t2 = t2 / n; printf (“Minimum time is %13.7f seconds\n”, t2); } foo(n){... }

Profilers A profiler automatically insert timing calls into applications to generate calls into applications It is used to identify the portions of the program that consumes the largest fraction of the total execution time. It may also be used to find system-level bottlenecks in a multitasking system. Profilers may alter the timing of a program’s execution

Profilers Data collection techniques Sampling-based This type of profilers use a predefined clock; every multiple of this clock tick the program is interrupted and the state information is recorded. They give the statistical profile of the program behavior. They may miss some important events. Event-based Events are defined (e.g. entry into a subroutine) and data about these events are collected. The collected information shows the exact execution frequencies. It has substantial amount of run-time overhead and memory requirement. Information kept Trace-based: The compiler keeps all information it collects. Reductionist: Only statistical information is collected.

Performance Evaluation Performance Evaluation steps: 1.Measurement / Prediction What to measure? How to measure? Modeling for prediction Simulation Analytical Modeling Queuing Theory 2.Analysis & Reporting Performance metrics

Predicting Performance Performance of simple kernels can be predicted to a high degree Theoretical performance and peak performance must be close It is preferred that the measured performance is over 80% of the theoretical peak performance

Homework 1 Write a C program to measure the execution time (elapsed time) of an addition operation (i.e. a=b+c). Run your program on both Windows and Linux systems. Use a timer that has at least  s resolution. Prepare a one-page report and explain the following: Your method to measure time Your code Specifications of the system that you run your code (processor, clock speed, etc.) Your measurement results Comments on your results