Just rambling about optimization...

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri May 10 04:36:12 AEST 1991


In article <721 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
> dsimon at eniac.seas.upenn.edu (Derron Simon) writes:
    [ wants a source-code optimizer ]
> I'm not surprised.  It is of very little use.

That's what I mean by counterproductive. But rather than trying to
convince you that any competent human can easily outdo the best
available automated optimizers, let me show you an unarguable advantage
of source-code optimization.

A typical math library takes hours, often even days to compile on each
machine. Installing several libraries can start taking a huge chunk from
the CPU time available for users. Why is compiling so slow? Because the
optimizer spends so much time searching for optimizations that could
have been expressed at the source level.

Guess what? If someone includes a source-optimized version along with
the original code, you won't have to waste nearly as much time doing the
same optimizations again for your machine.

This points to a productive area of research: how to make languages
sufficiently expressive that all interesting optimizations *can* be
expressed portably at the source-code level. Now doesn't this seem more
useful than answering every optimization question with ``It is of very
little use''?

---Dan



More information about the Comp.lang.c mailing list