good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Re: Re: Re: Processing data with lot of math...by itub (Priest) |
on May 13, 2004 at 13:50 UTC ( [id://353059]=note: print w/replies, xml ) | Need Help?? |
I'm sorry, you are right that it's always good to avoid redundant operations. I just wanted to point out that sqrt was not a likely bottleneck, but that the algorithm was the problem (and in that we agree). By avoiding sqrt you might get a size-independent 5% percent improvement if you are lucky, but by using a better algorithm you get a 99% improvement for sufficiently large systems if you have N^1 scaling instead of N^2 (note: by improvement I mean reduction in execution time).
In Section
Seekers of Perl Wisdom
|
|