optimize vector code

Bill Baxter dnewsgroup at billbaxter.com
Fri Nov 30 11:01:41 PST 2007


Sascha Katzner wrote:
> 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. :(

It's been mentioned before that DMD is particularly poor at floating 
point optimizations.  If it matters a lot to you, you might be able to 
get better results from GDC, which uses gcc's backend.  If you do try it 
I'd love to hear the benchmark results.

--bb


More information about the Digitalmars-d-learn mailing list