From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Announce: glome-0.2 (ocaml-based raytracer)
Date: Wed, 17 Jan 2007 23:09:51 +0000 [thread overview]
Message-ID: <200701172309.52011.jon@ffconsultancy.com> (raw)
In-Reply-To: <aee06c9e0701171501j53f36052iedcab0ce0811bdb4@mail.gmail.com>
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:
http://www.ffconsultancy.com/temp/glome.tar.bz2
I'm compiling with:
ocamlopt -inline 100 -unsafe -noassert -I +lablGL lablgl.cmxa
lablglut.cmxa -dtypes vec.ml clr.ml material.ml types.ml sphere.ml
triangle.ml group.ml kdtree.ml solid.ml camera.ml light.ml scene.ml trace.ml
glome.ml -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
http://www.ffconsultancy.com/products/ocaml_for_scientists
next prev parent reply other threads:[~2007-01-17 23:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-12 1:24 Jim Snow
2007-01-12 12:16 ` [Caml-list] " Jon Harrop
2007-01-15 10:30 ` Jim Snow
2007-01-15 18:34 ` brogoff
2007-01-17 23:01 ` Nathaniel Gray
2007-01-17 23:09 ` Jon Harrop [this message]
[not found] ` <200701151206.34251.jon@ffconsultancy.com>
[not found] ` <45ABFB4D.3000605@cs.pdx.edu>
[not found] ` <200701152259.10598.jon@ffconsultancy.com>
2007-01-18 10:29 ` Jim Snow
2007-01-18 14:01 ` Jon Harrop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200701172309.52011.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox