CSCE 3612 ch5-3

CSCE 3612 ch5-3 - Program design and analysis Program-level...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Program design and analysis Program-level performance analysis. Optimizing for: Execution time. Energy/power. Program size. Program validation and testing.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Program-level performance analysis Need to understand  performance in detail: Real-time behavior, not  just typical. On complex platforms. Program performance    CPU performance: Pipeline, cache are  windows into program. We must analyze the entire  program. © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed.
Background image of page 2
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Complexities of program performance Varies with input data: Different-length paths. Cache effects. Instruction-level performance variations: Pipeline interlocks. Fetch times.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. How to measure program performance Simulate execution of the CPU. Makes CPU state visible. Measure on real CPU using timer. Requires modifying the program to control the  timer. Measure on real CPU using logic  analyzer. Requires events visible on the pins.
Background image of page 4
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Program performance metrics Average-case execution time. Typically used in application programming. Worst-case execution time. A component in deadline satisfaction. Best-case execution time. Task-level interactions can cause best-case  program behavior to result in worst-case  system behavior.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Elements of program performance Basic program execution time formula: execution time = program path + instruction timing Solving these problems independently helps  simplify analysis. Easier to separate on simpler CPUs. Accurate performance analysis requires: Assembly/binary code. Execution platform.
Background image of page 6
Data-dependent paths in an if statement if (a || b) { /* T1 */ if ( c ) /* T2 */ x = r*s+t; /* A1 */ else y=r+s; /* A2 */ z = r+s+u; /* A3 */ } else { if ( c ) /* T3 */ y = r-t; /* A4 */ } a b c path 0 0 0 T1=F, T3=F: no assignments 0 0 1 T1=F, T3=T: A4 0 1 0 T1=T, T2=F: A2, A3 0 1 1 T1=T, T2=T: A1, A3 1 0 0 T1=T, T2=F: A2, A3 1 0 1 T1=T, T2=T: A1, A3 1 1 0 T1=T, T2=F: A2, A3 1 1 1 T1=T, T2=T: A1, A3 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Paths in a loop for (i=0, f=0; i<N; i++)  f = f + c[i] * x[i]; © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. i=0 f=0 i=N f = f + c[i] * x[i] i = i + 1 N Y
Background image of page 8
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 52

CSCE 3612 ch5-3 - Program design and analysis Program-level...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online