Floating point performance again
Andreas Raab
andreas.raab at gmx.de
Sat Dec 16 03:45:13 UTC 2006
David Faught wrote:
> I was expecting good things as a result of this, but was rather
> disappointed. The before and after tally results are below. They
> show that the B3DVector3(FloatArray) *, -, and + operation times went
> away (as expected) with pretty big increases in the primitives (this
> is just shifted from the original operations) and
> B3DVector3Array>>at:put: times, which was not expected. What
> happened, especially with the at:put: times?
Two possibilities: First, it may be a sampling error since you are only
using 16 msecs intervals which is extremely coarse and should not be
used for such a quantitative comparison. Get down to 1 msec instead.
Second, I have occasionally seen primitive tallies to be assigned to
other than their containing methods. I'm not sure why this happens but
the only way to find out for sure is to convert all of the primitives
into "real sends" (e.g., put extra methods in which call the primitives).
> I could see a shift like this in the percentages, but the actual
> measured times went way up too, with the overall total time being not
> very much less for the "optimized" version. Any ideas?
As an overall, the difference isn't too surprising. Assuming this was
running with the same parameters, you get some six seconds overall
speedup which is a roughly 12% speedup. That's not bad and you should
continue along those lines (like actually measuring the "fast square
root" since I'm not convinced that it's either correct or faster than a
straightforward sqrt).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|