Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
Premature Optimization - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, Xamarin.iOS, Xamarin.Android, and Windows Azure.

News

Visual Studio Magazine Column Personal Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Archives

Premature Optimization

A couple of weeks ago, I was sitting at lunch with a buddy of mine.  He was talking about all of this complicated programmatic caching of data that one of his customers was doing.  I remember stating that caching was only a good idea when there was a bottleneck.  I decided to drop the conversation because we were headed in an awkward direction.  You see, I have seen a lot of programmers try and implement caching because it is cool as oppossed to there being a real performance problem.  Alex Lowe refers to this as "Premature Optimization."  It reminded me of a situation I walked into a couple of years ago where a previous programmer was caching all kinds of data for this customer (different than previously mentioned).  The application is just dog slow.  I'm writing a new application for this customer (the one that has the slow application).  This new application is truly fast.  I remembered all this as I see that page refreshes occur in 1-2 seconds as oppossed to to 10-12 seconds on their other application.

BTW, I am not trying to toot my own horn.  I am merely saying that you should be aware and not spend lots ot time, effort, energy until you have the time to perform an analysis of your application and carefully analyze your bottlenecks. 

Beware of "Premature Optimization."

Really good article on the subject if you like things like Order of N2.

Comments

Karl said:

In my experience, the enemy isn't premature optimization, it's simply a poor job at optimization. Maybe it's premature because it wasn't properly planned...but more often than not I find it's a result of (a) people not really understanding how thigns work and (b) not providing concrete metrics to measure their efforts.

Performance should be a first class non-functional requirement and, in my opinion, needs to be addressed upfront and throughout. That said, it needs to be well thought out and executed like all other development disciplines....

I'm in a situation where I say "we should look at caching that"...and I'm told "well, we did that in the first version and look how slow it was". I have to constantly remind people that it isn't because it was cached that it's slow, it's because that it was poorly cached.
# April 27, 2005 10:01 AM