June 05, 2006
mike.benfield@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.


1 2
Next ›   Last »