2010-09-15

Performance Rant

I recently got on my performance soapbox again. I don't like repeating myself endlessly and my therapist advised me to write it all down to get it off my chest. So here it goes:


First of all, with today's computers performing some billions (as in 9 zeros, 1.000.000.000) operations per second does performance even matter? The answer must be a resounding YES for a multitude of reasons.

The term "computer" today covers a huge magnitude of devices with very different performance characteristics and capabilities. Think IBM mainframes, high end server hardware, office desktops, laptops, cell phones, GPS devices, ... Even if your high end Alienware gaming (ahem, "development") rig doesn't break a sweat doesn't mean others won't.

The free lunch is over. Programs once written will likely not get faster automatically with the advent of new hardware. It used to be that each new generation of CPUs would boost performance of existing software. Not any longer. We seem to be approaching some physical limits of how much further we can push CPUs. So we are sidestepping the issue and investing in parallel architectures. But software must be explicitly designed to take advantage of this, which is not easy. Cars aren't getting any faster, we are building wider highways instead.

Problem sizes keep growing. We keep demanding more of our machines. Text chat isn't enough anymore, it must be a live video conference with 10 participants. Games are approaching Hollywood blockbuster movie special effects quality, complete with voice acting, motion capture and serious camera work. A simple word document (yeah, yeah, I mean tex of course ;-) ) for a home work assignment would have made a professional typesetter proud a mere generation ago. Megabytes are trivial, we are counting Gigabytes today. All the way up to "google-scale" problems with "FuckYeahBytes" and computing power measured in acres.

User expectations have evolved. A keyboard and console isn't enough any more. We need animated, immediate feedback, graphical user interfaces. Voice recognition. Gesture recognition. Touch devices. Since there is such an endless plethora of applications to choose from our tolerance for lag is shrinking. If an app annoys us we simply switch to another.

Mobile devices and battery power. Inefficient code uses more CPU cycles than necessary, draining batteries. Desktop computers are getting smarter, dynamically reducing CPU energy usage based on current load levels. Efficient code saves energy, saves the planet: "green" computing!

Concurrency. Users are increasingly accustomed to a multitasking environment. Type your homework, watch some youtube, chat with your buddies, listen to music, download some torrents and tab in and out of WoW all at the same time. Or have a dozen browser tabs open each containing flash and media heavy interactive content. What about running multiple operating systems in virtual machines? Even multiple GBs of RAM can quickly be exhausted in such a scenario. Applications need to be good citizens and not assume ownership of all of a machine's resources.

Servers. The modern web experience requires massive server infrastructure behind the scenes. Efficient server code has dramatic effect on the bottom line. If a performance improvement of 10% means you have just saved 20.000 additional servers that's a huge win in maintenance and acquisition costs. Take facebook as an example, where choosing C++ over PHP could have just provided such a boost. And indeed, they have built a custom PHP to C++ translation engine (Hiphop).

So yes, performance is as relevant today as it has ever been in computing. And it gets honored by the marketplace as well. Slick, smooth user interfaces are appreciated - witness the success of Apple or Win7 (and it is no accident either but a very conscious effort).

Next up: my performance pet peeves.