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


  • John Moore: We use your application in our company for short consulting and update tasks.. Here are some suggestons.. 1) Allow for "re-mail" of tracks (This i
  • iPhone Aviation Apps | Pilotbug: [...] - Heikki Julkunen SnowTam – Maclogbook.com The Pilots Library – Bondworks.net Timed Turns - Matt Stockton touchPlan – MerlinFlyte USAvia
  • matt: Currently, only the Trak tag can be edited from the list views. I am sorry if the description was confusing (going back and reading it, I can see how

About

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

Archives

My Tweets (@mstockton)

  • getting some work done on ThisOrThat, the latest iPhone app...collaboration with @eligratz 2 weeks ago
  • @blakesamic awesome I've been thinking about getting a pair. Let me know how they feel after a few runs in reply to blakesamic 2010-01-12
  • 3...more...days...of...studying...ever (or at least until I decide to go back to school again) 2009-12-08
  • wrapping up my Master's degree in 17 days. excited to have free time to get back to iPhone development! lots of ideas in the pipeline 2009-11-22
  • obligatory monthly twitter update 2009-11-04
  • Last class for my master's degree... Data mining...I'll probably be bored after this is over! More iPhone apps? 2009-09-10
  • @btweeter82 nice dude in reply to btweeter82 2009-09-07
  • @eligratz nice work. Make sure u rate it appropriately. 1 of my apps got rejected for an incorrect rating! Let the waiting game begin... in reply to eligratz 2009-08-24
  • Just ran 8.5 miles. That's the longest I've ever run, and I actually don't feel too bad after it 2009-08-22
  • Heading back to Milwaukee on the lake express ferry. Pretty nice on here! 2009-08-18
  • More updates...

Posting tweet...

Powered by Twitter Tools