Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.c Subject: Re: Some optimization results Message-ID: <3501@charon.cwi.nl> Date: 11 May 91 01:18:28 GMT References: <3072:May700:46:3691@kramden.acf.nyu.edu> <22683@yunexus.YorkU.CA> <5850:May901:25:0491@kramden.acf.nyu.edu> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 31 In article <5850:May901:25:0491@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > In article <22683@yunexus.YorkU.CA> oz@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@cwi.nl