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

Philip Armstrong phil at kantaka.co.uk
Sat Jun 23 14:23:33 EDT 2007

On Sat, Jun 23, 2007 at 10:32:31AM +0100, Jon Harrop wrote:
>On Saturday 23 June 2007 08:58:10 Philip Armstrong wrote:
>> On Sat, Jun 23, 2007 at 03:28:53AM +0100, Jon Harrop wrote:
>> >What architecture, platform, compiler versions and compile lines are you
>> >using?
>> 32-bit x86...
>Intel or AMD?

AMD. Athlon 64 3000+ to be precise.

>> >  http://www.ffconsultancy.com/languages/ray_tracer/code/5/ray.ml
>> >  http://www.ffconsultancy.com/languages/ray_tracer/code/5/ray.cpp
>> I gather these use algorithmic optimisations.
>Both. Versions 1-4 are progressively algorithmic, version 5 includes low-level 
>optimizations (mostly manual inlining and unrolling). Implementing version 1 
>is probably also interesting: it is the most concise version.
>BTW, the ray tracer leverages the semantics of the float infinity (as the 
>parameter when there is no intersection). Shouldn't be a problem but some 
>compiler options might break it.

Thus far the Haskell version generates identical images to the OCaml


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

More information about the Haskell-Cafe mailing list