Execution time bottleneck: How to speed up execution?
Dik T. Winter
dik at cwi.nl
Fri Feb 15 00:31:13 AEST 1991
In article <24587:Feb1411:32:5391 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
> Look, Richard's original took 15.6 seconds on a Sun, 14.2 with cc -O4,
> all with n = 1000. Mine took 15.0 seconds, 13.8 with cc -O4. That's a 4%
> speedup.
Great.
>
> On a Convex, Richard's took 3.91 without optimization, 3.03 with. Mine
> took 3.56 without, 2.72 with. That's a 10% speedup.
Looks better.
>
> With a fast exp I have lying around, the speedups become 33% and 52%
> respectively. (This exp uses four tables of size 65536 and does table
> lookup.)
But that is what you are looking for.
>
(First, I had already mailed my solution to the original poster, which was
basicly the same as Ricard O'Keefe's and Doug Gwyn's, plus some additional
suggestions.)
> Dik, take a step back and look at your contribution to this discussion.
> Who's trying to be more helpful, you or me? I'm saying ``Here are some
> optimizations. I hope you find them useful.'' You're saying ``Don't
> optimize your code. Even though you care about its speed enough to spend
> a few minutes asking the net for help, surely you don't think it's worth
> a few minutes of programming time to make it run noticeably faster.''
I did not say that. What I said is that the transformations you gave will
not improve it very much (and indeed you find 4% and 10% respectively; the
10% probably due to the vectorization). Further I said that it is worthwile
looking at the exponential; which you just confirmed! So who is more helpful?
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. Now if your
suggestion had been to use your fast exponential..... (And, sorry, I do not
have one nearby, so I could not offer one.)
--
dik t. winter, cwi, amsterdam, nederland
dik at cwi.nl
More information about the Comp.lang.c
mailing list