MATTSTOCKTON.com

11 Mar, 2009

Where did this month go? And don’t optimize!

Posted by: matt In: Uncategorized ()

People have told me that it isn’t easy to keep up a blog. Now I know what they mean! Somehow, I’ve gone an entire month without posting anything — time seems to have flown by! I will try to be better at this, and post here at least 1 time a week (2 may have been a bit of an ambitious start)

I’m already halfway through this semester’s UIUC course (CS 433 – Computer System Organization), and that has been taking up a bunch of my time – I wasn’t too crazy about taking the course (given that I am more of a software guy), but it is a requirement for graduation.

Needless to say, the class has been awesome so far! The material is both interesting and challenging. Currently, we are learning about different software and hardware solutions to improve processors — there’s some really interesting stuff in this domain!

At a high level, the course has brought me to two conclusions with regards to developing software:

  • Choose clarity over optimization, because the lower levels will help you with the optimization anyway – Here, I am talking about the ‘small’ optimizations that people tend to make in code that can make the code very unclear (large scale optimizations involving architecture, etc. are still absolutely necessary). One of my least favorites of this is caching a calculated value when the calculation takes a very short amount of time. If the calculation is easy, just do it every time in a method! The overhead of managing the cached value, knowing when it is stale, etc. is not worth it!
  • The impact of optimization from single Processor improvements (Pipelining optimizations, dual issue, Branch predication schemes, clock speed, etc.) is slowly fading, as is evidenced by the recent explosion of multi-core systems.  Squeezing in a few more instructions in a clock cycle is not going to cut it anymore. This is quite interesting, as now the burden for optimization will shift to the developer.  We will have to spend some effort to plan our software such that we are effectively utilizing the multiple available processors! This could mean a paradigm shift in how software is developed to run on the multi-cores.

There’s actually some pretty good quotes out there with regards to Software Optimization that I’ll leave you with. Print these, put them in your cube, and look at them next time you want to do something stupid for optimization’s sake:

“Rule 1: Don’t do it….. Rule 2: (for experts only) Don’t do it yet” – M.A. Jackson

More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason – including blind stupidity.” - W.A. Wulf

“Optimization is non-optimal” – Me

Anyway, that’s it for now.  For my next blog article, I am thinking about discussing the pitfalls of unit testing. Sound interesting?

No Responses to "Where did this month go? And don’t optimize!"

Comment Form


  • Belton: Love the app. However, recently after upgrading to iPhone 4 with ios5. My phone has been locking up when I try to open the text I sent. Also, some of
  • Lisa: My group texting was working until recently after updating my Iphone 4S, but now only the Iphone contacts in my group are receiving the messages. Wh
  • Mickey Eckles: Love the app. It seems like 2-3 names disappear on my lists randomly. One time they are all there. The next time I text, one or two people are miss

About

Rants, Raves, Thoughts, and Spins on Software, Technology, and maybe a bit of everything else!

Archives

My Tweets (@mstockton)

Powered by Twitter Tools