SLIDE 4 4 4
CIS 422 S98 / M Young 1/21/99 7
Scaffolding
Build more than the application code
- Test drivers and cases
- Data structure viewers and validators
– For any complex data structure, build tools to view it
- n demand, and to perform validity checks
- Instrumentation
– Any performance-critical part of the program should be capable of measuring itself
– Build “substitute” parts for testing and debugging
CIS 422 S98 / M Young 1/21/99 8
Avoid Inappropriate Optimization
- Consider efficiency only when/where needed
– Efficiency is unimportant for many programs
- Have a concrete performance goal, and a ra
tionale for it.
- KISS: If the goal can be met by simple algorithms and data
structures, do not use complex alg
nd structures
– 80/20 rule: Efficiency is unimportant for most parts of a program
- Even if performance is a problem, it probably effects only a
small pa rt of the program. Identify them (by measuring), and put the effort where it matters.
– W ork at the highest possible level
- Start with overall design, then algorithms and data structures;
code-level optimizations s hould be used spa ringly, if at all.