From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id DD0B7BC0B for ; Thu, 18 Jan 2007 00:11:31 +0100 (CET) Received: from pih-relay04.plus.net (pih-relay04.plus.net [212.159.14.131]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0HNBU4b027782 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 18 Jan 2007 00:11:31 +0100 Received: from [80.229.56.224] (helo=[10.0.0.5]) by pih-relay04.plus.net with esmtp (Exim) id 1H7JwH-0002hg-SE for caml-list@yquem.inria.fr; Wed, 17 Jan 2007 23:11:30 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. 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 User-Agent: KMail/1.9.5 References: <45A6E34A.6040007@cs.pdx.edu> <45AB57B3.8050800@cs.pdx.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701172309.52011.jon@ffconsultancy.com> X-Miltered: at concorde with ID 45AEAD22.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursion:01 ocamlopt:01 -inline:01 -unsafe:01 -noassert:01 lablgl:01 lablgl:01 cmxa:01 lablglut:01 cmxa:01 vectors:01 arrays:01 -unsafe:01 fpls:01 ocaml:01 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