Raytracing speed again, this time with gdc.

downs default_357-line at yahoo.de
Wed Nov 7 07:13:42 PST 2007


I've tried to translate the attached C++ program to D (D program also
attached).

Even after explicitly using the __builtin_sqrt (which correctly
generates a fsqrt instruction (shame on you, non-inlined std.math)), the
D code is significantly slower (12.9s for D vs 9s for C++).

Does anybody know why this is so?
 --downs, confused and saddened

PS: benchmark

gentoo-pc ~/d/RayBen $ gdc ray1.d -O3 -frelease -ffast-math -o ray1_d
tools/base.d && time ./ray1_d >result_d.pnm; g++ ray1.cxx -O3
-ffast-math -o ray1_cpp && time ./ray1_cpp > result_cxx.pnm

real    0m13.448s
user    0m12.730s
sys     0m0.090s

real    0m10.128s
user    0m9.810s
sys     0m0.020s
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ray1.cxx
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20071107/e76663dd/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ray1.d
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20071107/e76663dd/attachment-0001.txt 


More information about the Digitalmars-d-learn mailing list