[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 11:36:51 EDT 2007

On Thu, Jun 21, 2007 at 01:45:04PM +0100, Philip Armstrong wrote:
>As I said, I've tried the obvious things & they didn't make any
>difference. Now I could go sprinkling $!, ! and seq around like
>confetti but that seems like giving up really.

OK. Looks like I was mistaken. Strictness annotations *do* make a
difference! Humph. Wonder what I was doing wrong yesterday?

Anyway timings follow, with all strict datatypes in the Haskell

Langauge File     Time in seconds
Haskell  ray.hs   38.2
OCaml    ray.ml   23.8 
g++-4.1  ray.cpp  12.6

(ML & C++ Code from

Gcc seems to have got quite a bit better since Jon last benchmarked
this code.


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

More information about the Haskell-Cafe mailing list