Execution time bottleneck: How to speed up execution?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Feb 15 03:46:43 AEST 1991


Dik, the optimizations I posted in a previous article are responsible
for between a 4% and a 50% speedup, depending on your machine, your
compiler, etc. This isn't the speedup you get from an optimizing
compiler. This isn't the speedup you get from buying a new machine.
This is the speedup from the ``ludicrous'' ``micro-optimization'' that
you took such pains to criticize.

In article <2940 at charon.cwi.nl> dik at cwi.nl (Dik T. Winter) writes:
> (and indeed you find 4% and 10% respectively; the
> 10% probably due to the vectorization).

As I said the first time, the 10% is the speedup you get on a Convex
with the standard math library exp() when you apply the ``ludicrous''
optimizations I pointed out. It is not due to vectorization.

> You gave just a few random solutions that result in a 4% speedup on a Sun,
> while the suggestion I did can give large improvements.

Yes, and I could equally well have said ``buy a Cray.'' If the original
poster didn't have a Cray this would result in ``large improvements.''
Similarly, the code becomes quite a lot faster if the poster uses a fast
exp()---but do you really think that ``use a fast exp()'' is any more
helpful than ``buy a Cray''? No. Neither one answers the question.
Furthermore, if the poster *does* have a fast exp() running on his Cray,
the optimizations I posted will give an even better speedup.

---Dan



More information about the Comp.lang.c mailing list