optimize vector code

Sascha Katzner sorry.no at spam.invalid
Fri Nov 30 10:28:31 PST 2007


Bill Baxter wrote:
> All I know is that actual benchmarking has been done on raytracers and 
> changing all the pass-by-values to pass-by-ref improved speed.
> 
> I have no idea what your sizeof is benchmarking there.  But if you're 
> interested in actual execution speed I suggest measuring time rather 
> than bytes.  I'd be very interested to know if pass-by-ref is no longer 
> faster than pass-by-value for big structs.

Youre right, comparing the size of the generated code was a VERY rough 
estimate... and wrong in this case.

I've benchmarked the three cases and got:
9.5s without ref
6.7s with ref (<- your suggestion)
4.1s manual inlined

So, it is a lot faster indeed, but yet not as fast as inling the 
functions manually. :(

LLAP,
Sascha
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vector.d
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20071130/f048bc5f/attachment.txt 


More information about the Digitalmars-d-learn mailing list