Improving Performance
[Back]
There are two important rules to remember when modifying programs to
improve performance.
These might seem obvious, but in practice they are often forgotten.
- Don't put performance above correctness.
When you modify the code, and especially when you change the design, always
take care to preserve program correctness.
After you change the code, you'll want to test its performance.
Do not forget to test its correctness.
- Measure your progress.
Try to keep track of the performance improvements you make.
This should include running your application without profiling overhead,
and also with profiling enabled. Then compare the times.
HPjmeter enables you to compare the same metrics from
"before" and "after" runs.
It is worthwhile to check to be certain that an improvement in one area
is not offset by degradation in another.
Similarly, some changes, for example, inlining, may not be worth
the effort
if the performance improvement is negligible, and the code
readability or flexibility suffers.
[Back]