When you had a 4Mhz machine with 640KB each cycle and each KB of ram
were precious. I spent an entire day tuning a loop that computes UDP
checksums on a 4.77Mhz machine because my measurements showed that a
good deal of my time was in that loop. It was worth rewriting the
perfectly good C for loop into inline ASM to squeeze a few hundred
thousand cycles per 1K packet.
On the early architectures I did professional work on (AS/400) we were
exceedingly careful to keep data structures aligned on cache boundaries,
have read-only and read/write areas in different cache lines, etc.
Those extra interrupts for bad alignment or extra cache traffic were
very noticeable, even on faster machines.
But now with CPUs doing 2GHz+, I can afford to blow a few cycles.
Goodness knows, the OS and software that I'm building on top of are
blowing quite a few for me already. Ever stop to think how much the eye
candy on a Windows XP costs to run? Or even on a Linux machine .. lots
of bloat now.
Machines used to be more expensive than programmers. Now programmers
are generally far more expensive than machines. There is less need to
squeeze every cycle. The goal now is to squeeze every productive minute
out of the expensive resource, which is now the human. Only at the very
high end of computer science (super computers) do people still go after
absolute performance .. for the real world, 'good enough' is the rule.
Rational Application Developer 6 needs a 2GB machine to run nicely.
Sounds horrible, until you knock out a web application in a day or two.
This is an extreme example, but you get the point.
Mike