On TV.com: Dollhouse CANCELED, What Went Wrong?
BNET Business Network:
BNET
TechRepublic
ZDNet

April 23rd, 2006

Truths about code optimization

Posted by Ed Burnette @ 7:53 pm

Categories: General, Java, Programming

Tags:

In his blog, Russ Olsen shares some words of wisdom about optimizing Java code (or any code for that matter). It’s mostly common sense such as starting with working code, profiling first, and re-profiling after each change. I agreed with all of it until I got down to the last section where he wrote:

Much of the time optimization is the process of taking nice code and making it longer, more complex, harder to read. In short, less nice. Really we should stop using the term optimization. We should call it what it really is: screwing up the code so that the it performs better or maybe justifiable mutilation.

If that’s what you find yourself doing when optimizing a program, it’s time to step back and rethink your strategy. I’ve found that most performance problems are really caused by bad algorithms, and not "short, simple, easy to read code" as Russ seems to suggest here. Good algorithms are elegant and thoughtful, not hacked up mutilated kludges.

In my opinion, developer performance is much more important than run-time performance. Why? Because a productive developer will have time to architect things the right way, to do the profiling, and to refine and refactor the algorithms. An unproductive developer dealing with screwed up and mutilated code will only have time to fight fires, hosing down one section after another until the whole soggy mess collapses.

Ed BurnetteEd Burnette is a professional developer and author of several articles and books about computing including Hello, Android: Introducing Google's Mobile Development Platform, 2nd Edition. For disclosure of Ed's industry affiliations, click here or to view his full profile click here.

Email Ed Burnette

Subscribe to Dev Connection via Email alerts or RSS.

Talkback

Add your opinion

SponsoredWhite Papers, Webcasts, and Downloads

advertisement
Click Here

Recent Entries

Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
The more you simplify, the more you save
When you transition from your existing Red Hat environment to SUSE Linux Enterprise from Novell, you can recognize dramatic cost savings, perhaps as much 50%
Learn more >>
The best support in the Linux business
If Linux is going to power your mission-critical applications, you'd better have the best support known to business. Novell was rated the top provider of Linux technical support.
Learn more >>
Microsoft Dynamics CRM Online - Free Six-Month Trial for Eligible Organizations
Microsoft Dynamics CRM Online provides fast online access, simple contact management and better sales performance for a low monthly cost - the best value on the market today.
Learn more about the free, six-month trial offer>>
Learn more about tools to grow your business
The Business Essentials Guide provides you useful tools and templates to help grow your business and save you time with automated shipping solutions.
Save time with the UPS Business Essentials Guide
Keep Up With The Latest In Document Management with The DocuMentor.
Doc delivers the scoop on today's enterprise content management, printer maintenance, and all other issues related to document management. It's the DocuMentor Blog.
Learn more >>
Reduce risk. Reduce complexity. Increase reliability.
A simplified IT environment isn't just less complex. It's also more reliable. Standardize on a single Linux platform with SUSE Linux Enterprise from Novell, and get the world's most interoperable Linux
Learn more >>

Archives

Favorite Links

ZDNet Blogs

White Papers, Webcasts, and Downloads