What is the most ridiculous pessimization you’ve seen? [closed]

I think the phrase “premature optimization is the root of all evil” is way, way over used. For many projects, it has become an excuse not to take performance into account until late in a project.

This phrase is often a crutch for people to avoid work. I see this phrase used when people should really say “Gee, we really didn’t think of that up front and don’t have time to deal with it now”.

I’ve seen many more “ridiculous” examples of dumb performance problems than examples of problems introduced due to “pessimization”

  • Reading the same registry key thousands (or 10’s of thousands) of times during program launch.
  • Loading the same DLL hundreds or thousands of times
  • Wasting mega bytes of memory by keeping full paths to files needlessly
  • Not organizing data structures so they take up way more memory than they need
  • Sizing all strings that store file names or paths to MAX_PATH
  • Gratuitous polling for thing that have events, callbacks or other notification mechanisms

What I think is a better statement is this: “optimization without measuring and understanding isn’t optimization at all – its just random change”.

Good Performance work is time consuming – often more so that the development of the feature or component itself.

Leave a Comment