Malcolm said:
I thought that your point was that speed of development was what
matters. Normally this is the case. The programmer who gets his
code out in two days, executing correctly, is normally doing a better
job than the one who gets it out in three days, running a little bit
faster. Not always of course.
In the shrink-wrap world, that's definitely true. In the embedded world,
efficiency is a do-or-die proposition because code efficiency dictates what
parts you need to use and what features you can offer -- bad code can cost
you millions by forcing you to use more expensive processors, more memory,
etc. and possibly price you out of the market.
Case in point: one of our coders spent a couple weeks working on tweaking
our product's code to improve performance, and managed to eliminate 55% of
the cycles on a very common operation that's executed thousands of times per
second. Now we have nearly a hundred MIPS more available to add new
features to existing products and it'll be that much longer before we need
to move on to the next CPU. Easily worth the time.
Likewise, our DSP code is written by some phenomenally smart guys, and they
manage to do things the DSP's vendor claims are impossible. Not by
micro-optimization, but by using smarter (and now patented) algorithms.
That work saves us tens of millions of dollars per year by allowing us to
buy a $5 DSP instead of the $20 one -- well worth the years of effort
they've spent (and continue to spend) tweaking things.
If you know that the compiler does a top-notch job on micro-optimisation,
you can write code so that it is easy to read rather than easy to compile.
This means fewer bugs, and bugs very often delay shipping and cause
projects to lose money.
That's the goal. The adage "it's easier to make correct code fast than make
fast code correct" has a lot of merit. We obsess about getting the code
right the first time, and customers notice. Unfortunately, that means
delays sometimes, but we've gotten to the point most customers don't even
test our products before rolling them out to users, because they know our
stuff works out of the box every time. You can't buy that kind of
marketing.
S