Some optimization results

Dik T. Winter dik at cwi.nl
Sat May 11 11:18:28 AEST 1991


In article <5850:May901:25:0491 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
 > In article <22683 at yunexus.YorkU.CA> oz at yunexus.yorku.ca (Ozan Yigit) writes:
 > > If by "serious thought about optimization" you mean something like your
 > > last attempt to optimize and make a mess out of what was already cleanly
 > > done by Richard O'Keefe, I think you have yet to find out the meaning of
 > > the word [counterproductive]. ;-)
 > 
 > Yeah, that's exactly the sort of thing I mean, and it turned out to be
 > extremely productive.
Ah, bah.
 > 
 > The code after O'Keefe's optimizations would not be automatically
 > vectorized by the Cray compiler. The code after my optimizations would,
 > with no special directives or further work on the programmer's part.
 > In other words, the microoptimizations that you take such pains to
 > criticize ended up speeding up the code by a factor of fourteen.
You have forgotten something about our e-mail exchanges.  The reason the
Cray compiler did not vectorize was some silliness of the compiler writer
or somesuch.  The compiler saw dependencies that were not there.  And that
was the new compiler (scc); interestingly enough with the standard compiler
(cc) your code would not vectorize as well.  And as I have mailed you, when
(by the proper directives) the compiler would vectorize your codes were
marginally faster or a bit slower than Richard O'Keefe's.

In general micro-optimization does not pay, but:
It is silly to call something an optimization when it is nothing more than
a work-around for a compiler bug.  And still sillier when it is slower
without compiler bug.
--
dik t. winter, cwi, amsterdam, nederland
dik at cwi.nl



More information about the Comp.lang.c mailing list