Why is this D code slower than C++?

BCS BCS at pathlink.com
Wed Jan 17 14:37:35 PST 2007


nobody_ wrote:
> I really hope you'll get it faster than the C++ variant.
> 
> Might -profile shed some light?
> Or maybe I lurk here in learn for a reason :D
> 
> 
> 
>>Thanks for all the suggestions. It helps, but not enough to make the D
>>code faster than the C++. It is now 2.6 times slower. The render times
>>are now approx. 13 sec for raytracer_d and approx. 5 sec for 
>>raytracer_cpp.
>>
>>Here are the changes I've made. Attached is the new code.
>>
>>  Call RegisterClass outside of assert. (Broken if -release used)
>>  Apply -release option. (Increases speed in an unknown way)
>>  Converted templates to regular functions. (Templates not being inlined)
>>  Manually inlined DOT function. (Function not being inlined)
>>
>>
>>Any other suggestions?
> 
> 
> 

I ran it with -profile and it takes about 25 min.

here's the log

http://www.webpages.uidaho.edu/~shro8822/trace.log


More information about the Digitalmars-d-learn mailing list