Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Mini ray tracer

20 views
Skip to first unread message

Jon Harrop

unread,
Jun 12, 2005, 10:56:37 PM6/12/05
to caml...@yquem.inria.fr

I've been fiddling with my ray tracer again this weekend. This time I've come
up with a comparison of four different (progressively optimised) versions of
the ray tracer implemented in C++, Java, OCaml and SML:

http://www.ffconsultancy.com/free/ray_tracer/languages.html

OCaml is significantly more concise that the other languages (even SML) but
the big surprise for me was the incredible performance of straightforwardly-
written Mlton-compiled SML, even on AMD64 where it lacks a native code-gen.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Alex Goldman

unread,
Jun 12, 2005, 11:34:34 PM6/12/05
to Jon Harrop, caml...@yquem.inria.fr
> http://www.ffconsultancy.com/free/ray_tracer/languages.html

Thanks. A lot of very interesting stuff there. I'm surprised that
SMLNJ is as fast as OCamlopt on x86. I thought it had a reputation for
being slow because it's "continuations-based" (or whatever). Java is
the only one bytecode-compiled, so it's also interesting that it's
competitive in speed.

It might be interesting to see how C/C++ does when linked with Boehm's
GC. My own experiments with it impressed me very much.

Jon Harrop

unread,
Jun 16, 2005, 2:28:39 AM6/16/05
to caml...@yquem.inria.fr
On Monday 13 June 2005 04:24, Alex Goldman wrote:
> > http://www.ffconsultancy.com/free/ray_tracer/languages.html
>
> Thanks. A lot of very interesting stuff there. I'm surprised that
> SMLNJ is as fast as OCamlopt on x86...

Ahem, it seems that the evil Matthias Blume worked an ingenious bug into his
SML port of my ray tracer which sped it up by 70%. So I've redone the study
and SML is now much less favourable.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists

_______________________________________________

Jon Harrop

unread,
Jun 16, 2005, 11:54:30 AM6/16/05
to caml...@yquem.inria.fr
On Thursday 16 June 2005 07:20, Jon Harrop wrote:
> On Monday 13 June 2005 04:24, Alex Goldman wrote:
> > > http://www.ffconsultancy.com/free/ray_tracer/languages.html
> >
> > Thanks. A lot of very interesting stuff there. I'm surprised that
> > SMLNJ is as fast as OCamlopt on x86...
>
> Ahem, it seems that the evil Matthias Blume worked an ingenious bug into
> his SML port of my ray tracer which sped it up by 70%. So I've redone the
> study and SML is now much less favourable.

Matthias is denying all knowledge of this so I guess I'll have to take
responsibility myself. Anyhow, I've updated the language comparison with a
table comparing OCaml and SML:

http://www.ffconsultancy.com/free/ray_tracer/languages.html

--

0 new messages