This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: never optimize early
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Bob Congdon imparts some words of wisdom on optimizing. Nothing new or earth shattering, but something that far too many people ignore - I've fallen victim to early optimization more than once myself:
Optimization matters only when it matters. When it matters, it matters a lot, but until you know that it matters, don't waste a lot of time doing it. Even if you know it matters, you need to know where it matters. Without performance data, you won't know what to optimize, and you'll probably optimize the wrong thing.
The result will be obscure, hard to write, hard to debug, and hard to maintain code that doesn't solve your problem. Thus it has the dual disadvantage of (a) increasing software development and software maintenance costs, and (b) having no performance effect at all.
Too many times I've been at a customer site and had an exchange like this:
Them: Your product is too slow Me: Have you profiled? Do you know know what's slow? Them: No, we haven't profiled. But we know the problem is in (insert some vendor library here)
Invariably, I've whipped out the profiler, and found that the problem wasn't where they thought it was. Sometimes it is Cincom code; we are hardly perfect. However, it's almost never been where the developers thought it was....