D is awesome, my situation, questions

Dave Dave_member at pathlink.com
Mon Jun 5 07:13:28 PDT 2006


mike.benfield at gmail.com wrote:
> 
> (They also have the same comparison, but with Standard ML vs. C++:
> 
> http://www.ffconsultancy.com/free/ray_tracer/comparison_cpp_vs_sml.html
> 
> SML trounces the C++ program in performance too, but that's not really
> fair since they compiled with it with mlton, a whole program optimizing
> compiler.)

Using an easy and common C++ optimization (passing return value byref 
for the highly recursive intersect methods):

MLTON version:
user    0m10.037s

Old CPP version:
user 0m14.665s

New CPP version:
user 0m6.960s

C++ is still the same # of lines of code (code attached) w/ the same 
compiler flags.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ray_opt.cpp
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20060605/ccacae57/attachment.ksh>


More information about the Digitalmars-d mailing list