Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Announce: glome-0.2 (ocaml-based raytracer)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-01-17 (23:11)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Announce: glome-0.2 (ocaml-based raytracer)
On Wednesday 17 January 2007 23:01, you wrote:
> I haven't benchmarked, but I think you should get better results than
> if you were using virtual method dispatch in an inner loop.

I had already implemented that recursion trick but I accidentally sent my 
response to Jim alone without spamming the list. Here's my latest source:

I'm compiling with:

ocamlopt -inline 100 -unsafe -noassert -I +lablGL lablgl.cmxa 
lablglut.cmxa -dtypes -o glome

Balls 14, Jim's then mine:

kdtree build time: 0.772883
with gc: 0.786881
total  :2.393636

kdtree build time: 0.645902
with gc: 0.689895
total  :2.331646

Tetra, Jim's then mine:

kdtree build time: 6.934946
with gc: 6.952944
total  :0.429935

kdtree build time: 6.31004
with gc: 6.360033
total  :0.396939

So my implementation is ~8% faster. That isn't significant, but the reduction 
in source code of 25% is!

The code will be smaller and faster with records for vectors rather than 
arrays. More importantly, we can rid of that hideous -unsafe. I'll do it ASAP 
but I'm really busy writing more books on FPLs. ;-)

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists