Chapter 2 Program performance
Chapter 2 Program performance
2.1 Preface Performance of a program: the amount of computer memory and time needed to run a program We use two approaches to determine it performance analysIs performance measurement
2.1 Preface Performance of a program: the amount of computer memory and time needed to run a program We use two approaches to determine it: performance analysis performance measurement
2.1 Preface Space complexity: the amount of memory a program needs to run to completion Time complexity the amount of time a program needs to run to completion
2.1 Preface Space complexity: the amount of memory a program needs to run to completion Time complexity: the amount of time a program needs to run to completion
2.2 Space Complexity 1) components Instruction space data space (space needed for constants, simple variables, component variables environment stack space( to save information needed to resume execution of partially completed nctions
2.2 Space Complexity 1)components: instruction space data space (space needed for constants,simple variables,component variables) environment stack space (to save information needed to resume execution of partially completed functions)
2.2 Space Complexity two parts a fixed part--include space for instructions, simple variables fixed-size component variables. constants a variable part--include space for component variables, dynamical allocated space, recursion stack S(p=C+S,(instance characteristics)
2.2 Space Complexity two parts: a fixed part—include space for instructions,simple variables,fixed-size component variables,constants a variable part—include space for component variables,dynamical allocated space,recursion stack S(p)=c+Sp (instance characteristics)