Skip to content


Five Truths About Code Optimization

Russ Olsen’s essay Five Truths About Code Optimization is a quick read but does a good job of covering the basic truths of optimization:

  1. Start with working code and good tests or you are doomed
  2. Rest assured, you don’t know where the problem is
  3. There is always a long pole in the tent, but it is not always the same pole
  4. If it doesn’t help, take it out
  5. You need to know when to stop

I had to laugh when I saw Russ’ example for his second “truth” — I ran into the same issue with the RandomAccessFile class in Java when I was trying to speed up code that processed PDF files. RandomAccessFile does unbuffered IO which can be incredibly slow. In my case, switching to buffered IO reduced processing time by more than 95% for large files.

Posted in Uncategorized.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



bob congdon is Digg proof thanks to caching by WP Super Cache