Performance Analysis and Optimization. Performance: Time Space Power (cost) (weight) {development time, ease of maintenance, extensibility} Note: 1. “big-O”

Slides:



Advertisements
Similar presentations
Program Efficiency & Complexity Analysis
Advertisements

Carry Lookahead Homework
MATH 224 – Discrete Mathematics
CHAPTER 2 ALGORITHM ANALYSIS 【 Definition 】 An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition,
Data Structures: A Pseudocode Approach with C
Fundamentals of Python: From First Programs Through Data Structures
Chapter 11 Analysis of Algorithms. Chapter Scope Efficiency goals The concept of algorithm analysis Big-Oh notation The concept of asymptotic complexity.
Performance Analysis and Optimization (General guidelines; Some of this is review) Outline: introduction evaluation methods timing space—code compression.
Computational Complexity 1. Time Complexity 2. Space Complexity.
CSE 326 Asymptotic Analysis David Kaplan Dept of Computer Science & Engineering Autumn 2001.
Introduction to Analysis of Algorithms
Software Design Analysis of Algorithms i206 Fall 2010 John Chuang Some slides adapted from Glenn Brookshear, Marti Hearst, or Goodrich & Tamassia.
Complexity Analysis (Part I)
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
COMP 171 Data Structures and Algorithms Tutorial 10 Hash Tables.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Instruction Set Architecture.
Hashing General idea: Get a large array
Analysis of Algorithms 7/2/2015CS202 - Fundamentals of Computer Science II1.
Elementary Data Structures and Algorithms
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Data Structure & Algorithm Lecture 3 –Algorithm Analysis JJCAO.
Analysis of Algorithms Spring 2015CS202 - Fundamentals of Computer Science II1.
Pointers (Continuation) 1. Data Pointer A pointer is a programming language data type whose value refers directly to ("points to") another value stored.
1 Complexity Lecture Ref. Handout p
Program Performance & Asymptotic Notations CSE, POSTECH.
ITEC 2620A Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: 2620a.htm Office: TEL 3049.
Iterative Algorithm Analysis & Asymptotic Notations
Chapter 12 Recursion, Complexity, and Searching and Sorting
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Analysis of Algorithms
Chapter 19: Searching and Sorting Algorithms
Algorithm Evaluation. What’s an algorithm? a clearly specified set of simple instructions to be followed to solve a problem a way of doing something What.
Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.
Analysis of Algorithms These slides are a modified version of the slides used by Prof. Eltabakh in his offering of CS2223 in D term 2013.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Week 12 - Wednesday.  What did we talk about last time?  Asymptotic notation.
ITEC 2620A Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: 2620a.htm Office: TEL 3049.
Algorithm Analysis (Algorithm Complexity). Correctness is Not Enough It isn’t sufficient that our algorithms perform the required tasks. We want them.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
Chapter 10 Algorithm Analysis.  Introduction  Generalizing Running Time  Doing a Timing Analysis  Big-Oh Notation  Analyzing Some Simple Programs.
Computer Science and Software Engineering University of Wisconsin - Platteville 8. Comparison of Algorithms Yan Shi CS/SE 2630 Lecture Notes Part of this.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
1 Asymptotic Notations Iterative Algorithms and their analysis Asymptotic Notations –Big O,  Notations Review of Discrete Math –Summations –Logarithms.
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
David Luebke 1 1/6/2016 CS 332: Algorithms Asymptotic Performance.
Algorithm Analysis (Big O)
Data Structures Using C++ 2E
Searching Topics Sequential Search Binary Search.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: TEL 3049.
Program Performance 황승원 Fall 2010 CSE, POSTECH. Publishing Hwang’s Algorithm Hwang’s took only 0.1 sec for DATASET1 in her PC while Dijkstra’s took 0.2.
Fig Storage of a C program. Fig Memory allocation with malloc.
WHICH SEARCH OR SORT IS BETTER?. COMPARING ALGORITHMS Time efficiency refers to how long it takes an algorithm to run Space efficiency refers to the amount.
Algorithm Analysis with Big Oh ©Rick Mercer. Two Searching Algorithms  Objectives  Analyze the efficiency of algorithms  Analyze two classic algorithms.
Analysis of Algorithms Spring 2016CS202 - Fundamentals of Computer Science II1.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong.
CSE 3358 NOTE SET 2 Data Structures and Algorithms 1.
Data Structures and Algorithm Analysis Dr. Ken Cosh Linked Lists.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong
Review Graph Directed Graph Undirected Graph Sub-Graph
Cse 373 April 26th – Exam Review.
November 1st – Exam Review
ITEC 2620M Introduction to Data Structures
ITEC 2620M Introduction to Data Structures
Arithmetic Circuits (Part I) Randy H
Introduction to Algorithms Analysis
Algorithm Efficiency Chapter 10.
Algorithmic Complexity
Revision of C++.
8. Comparison of Algorithms
Presentation transcript:

Performance Analysis and Optimization

Performance: Time Space Power (cost) (weight) {development time, ease of maintenance, extensibility} Note: 1. “big-O” analysis not sufficient here, we are dealing with specific physical sizes 2. notation “big-O” often really means Θ

Arithmetic—basic algorithms Hierarchy of time complexity: increment / decrement addition / subtraction multiplication division / square root other operations can usually trade off time for space Example: addition of 2 16-bit numbers carry-ripple adder: time - 31 gate delays space - 16 full adders carry lookahead adder (4-bit units): time – 8 gate delays space – 4 4-bit CLA units—more gates, routing

fig_14_00 Example: summing array elements— linear in size of array

table_14_00 How to analyze performance and Do optimizations

fig_14_01 Rates of growth for commonly encountered complexity: Asymptotic complexity

fig_14_02 Time complexity: loop

fig_14_03 How does this differ from previous example?

fig_14_04 While loop

fig_14_05 Nested loops—example:

fig_14_06 Time complexity of conditional statements:

fig_14_07 Linear search:

fig_14_08 Selection sort:

Common data structures (not dynamic): Array: O(n) [move]: Insert / delete at beginning Insert / delete at end Insert / delete in middle O(1): Access at beginning Access at middle Access at end

Common data structures (not dynamic): Linked list: O(1): Insert / delete at beginning access at beginning O(n): insert / delete at end (or O(1) if extra pointer) insert / delete in middle Access at middle Access at end (or O(1) if extra pointer)

fig_14_09 Flow of control: sequential

fig_14_10 Loops/conditionals

fig_14_11 Example: loop

fig_14_12 Example: function call

fig_14_13 Code: C level

fig_14_14 Code: machine instruction set level

fig_14_16 If—2 levels

fig_14_18 While-2 levels

fig_14_19 Function call—machine level

fig_14_20 Function—C level

fig_14_21 What happens at machine level

fig_14_22 Function body– c level

fig_14_23 Function body—machine level

fig_14_24 Co-routines

fig_14_25 interrupts

fig_14_26 Response time—2 systems

fig_14_27 Best and worst case times

fig_14_28 Asynchronous events

fig_14_29 Memory: hierarchy / response times

table_14_03 Power usage for some common operations

fig_14_30 Power—sophisticated management possible

fig_14_31 Using a power manager

fig_14_32 Power management schemes

fig_14_33 Standard power modes

table_14_02 Ways to analyze performance during development