[Haskell-cafe] Haskell version of ray tracer code is much slower than the original ML

Philip Armstrong phil at kantaka.co.uk
Fri Jun 22 14:54:16 EDT 2007

On Fri, Jun 22, 2007 at 10:11:27PM +0400, Bulat Ziganshin wrote:
>Friday, June 22, 2007, 7:36:51 PM, you wrote:
>> Langauge File     Time in seconds
>> Haskell  ray.hs   38.2
>> OCaml    ray.ml   23.8 
>> g++-4.1  ray.cpp  12.6
>can you share sourcecode of this variant? i'm interested to see how
>much it is obfuscated


The cpp & ml versions are precisely those available from the download
links on http://www.ffconsultancy.com/languages/ray_tracer/comparison.html

The optimisation options I used can be seen in the makefile.

>btw, *their* measurement said that ocaml is 7% faster :)

Indeed. The gcc-4.0 compilied binary runs at about 15s IIRC, but it's
still much better than 7% faster than the ocaml binary.

cheers, Phil

http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt

More information about the Haskell-Cafe mailing list