Spiga

Is it still that important for programs to be efficient?

This is a very interesting and timely question. The writer's original question was longer: "With the advances in processing power and memory is it really important to make programs that utilize them efficiently? Will we really notice the performance difference?" This is a topic that everyone should consider. The immediate answer most people would come up with is "Of course programs should still be efficient" and naturally that's true, but the real question is a matter of how much emphasis should be put on efficiency, and my answer is "Probably not as much as you think."

For example, in PHP, there are certain easy steps you can take to make a program more efficient (such as only connecting to a database when necessary, caching pages, etc.), but I almost always caution people against taking efficiency much past the larger picture. In all likelihood, all of the extra effort would only improve the performance by a minuscule amount. The same is true for most technologies. One of the things that makes Ruby's approach stand out is that the creator started with the understanding that the programmer's time is more valuable than the computer's, so he focused on creating a language that one could program in efficiently, even if that meant that it executed somewhat less so. And this leads me to another point: the technologies selected for a project will probably have a greater impact on the performance than any tweaking you do (although, to be fair, sloppy programming in any language will always be worse than good programming).

Secondarily, outside considerations will likely have a greater impact.  I just bought a new computer and rather than spend any time trying to get it to run as efficiently as possible (e.g., by enabling or disabling features), I dropped another $70 (US) to double the amount of RAM from 2GB to 4GB (and getting 4GB of laptop RAM for only $70 is gluttonous).


So, in short, my advice would be to pay attention to a program's (or site's) overall efficiency without spending too much effort on the little details. An exception would be made for very, very, very popular sites, where a small tweak in performance makes a huge difference to the server. For example, Yahoo! gets 3.5 billion hits a day. Any slight improvement to their site really does matter. For most people, projects, and sites, though, that is not the case.

3 comments:

  Anonymous

May 8, 2008 at 7:12 AM

hello kumar,
you have a very informative blog here.keep up the good work

  Suresh Kumar A

May 8, 2008 at 8:27 AM

Thanks for your nice commnet prince

  Blog reader

May 16, 2008 at 9:01 AM

Ok, I am encouraged be you comment reply above,..........

I am trying to join "google map" screen shots to buid a poster size map. the problem is that i do not have a good computer and whev ever i try to load more than "few" photos into my paintshop it freezez.

Now i was looking for someone on the internet who has a good computer and willing to help..... so i found you (through a google blog search)

I have joind many photos and these are in 3 big posters. I just want to request you to please join these 3 parts (with a pixil precision) and send back me the one big poster.

i saw you have a 4gb ram. and you are like computer person. it will so kind of you if you help.

please reply here.
thanking you in anticipation.

salman
pakistan