Being performance minded while avoiding premature optimization

Premature optimization is the root of all evil.

- Donald Knuth

For those working on large projects it becomes evident why Dr. Knuth considered premature optimization the root of all evil. What usually starts out as a fairly simple discussion on how to improve performance can go down a rabbit hole until instead of working on the original problem you spend all your time re-implementing libraries.

It is only human nature to want to do things better. This is where it takes the most discreation. Whenever you come to the crossroads and you are trying to decide whether or not to re-implement a library or refactor an application entirely you must outline the Opportunity Cost. Making a pros/cons list helps, but even more setting a time limit on an improvement helps even more. If after a certain amount of time the improvement is not implemented I believe it should be abandoned.

On my most recent project I have been extremely focused on creating a web application that is ultra performant. This has led to some delays as I develop slower to ensure that the application is performant. During this process I have come to the realization that I am losing most of my time fretting over small performance increases instead of focusing on creating something that works and optimizing later.

Updated on: August 26, 2012
Tags: random thoughts, work in progress