Hardware is expensive

Posted by user on 28 Apr 2009

You probably heard at least once the hardware is free aphorism. Perhaps you even said it! The underlying notion is that optimizing code is generally more expensive than upgrading the machine or even buying a new one.

If you estimate the cost of an engineer at 500 € / day, 2 days of work are worth quite a nice upgrade. Spending one week to get a 20% performance boost can therefore sound crazy, notwithstanding the increased maintenance cost the optimization may incur.

Wrong.

First, your new computer has got maintenance costs. It needs to be installed and configured. It requires electricity to run. Even if this is just an upgrade you need to spend time making sure the upgrade works. And maybe upgrading the machine will break it and you will have to buy a new one. Or maybe your server room is full and you will need to find a new office, and finding a new office is something incredibly not fun.

Hardware is free means is that at some point, spending a lot of time optimizing your code is just a waste of time and money. When you start firing up assembly to get some more 10% extra "umph", it means the time to cool down has come.

The assertion is an intentional caricature of the underlying idea. Don't use it as an excuse to not improve your programs.

Are you going to request your customers to upgrade their machine?

Because, guess what, people love fast programs. Not only geeks: every user likes speed. Fast means well designed. It means clever. It means reliable. It means that the job will be done in a timely fashion. It means that if we were to be invaded by zombies, thanks to the fast program we would make it (the automatic shotgun would help as well though).

Every time I run a resource hogger I feel like I'm wasting my time. And then all sort of negative thoughts get associated with the resource hogger and the fate of the author. Think Clockwork Orange and you'll have a pretty good digest of what I mean by negative thoughts.

There is no good reason not to carefully review your design and your program when you hit a performance barrier. Maybe improving performances will require some head scratching, but hey, that's why you got two 30 inches screens and an awesome armchair. No, that wasn't so you could l33ch stuff all day while sharing with the rest of the world how awesome the last South Park episode was.

Engineering is hard. That's why it's expensive. That's why your customers pay premium for just a bunch of bytes on their hard disk.

Topics: optimization, programming, software, Uncategorized