From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 4D360BC88 for ; Tue, 8 Feb 2005 02:29:30 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j181TTNT002715 for ; Tue, 8 Feb 2005 02:29:29 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA31356 for ; Tue, 8 Feb 2005 02:29:29 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j181TPWo017046 for ; Tue, 8 Feb 2005 02:29:28 +0100 Received: from [192.168.1.200] (ppp212-197.lns2.syd3.internode.on.net [203.122.212.197]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j181TCMI073226; Tue, 8 Feb 2005 11:59:22 +1030 (CST) Subject: Re: [Caml-list] [Benchmark] NBody From: skaller Reply-To: skaller@users.sourceforge.net To: Christophe TROESTLER Cc: "O'Caml Mailing List" In-Reply-To: <20050207.195724.87945401.Christophe.Troestler@umh.ac.be> References: <20050207.195724.87945401.Christophe.Troestler@umh.ac.be> Content-Type: text/plain Message-Id: <1107826151.13571.199.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 08 Feb 2005 12:29:11 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 420815F9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 420815F5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 christophe:01 troestler:01 wrote:01 mutable:01 mutable:01 ocaml:01 unboxed:01 garbage:01 glebe:01 061:98 nsw:01 data:02 snail:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Tue, 2005-02-08 at 05:57, Christophe TROESTLER wrote: > type planet = { > mutable x : float; mutable y : float; mutable z : float; > mutable vx: float; mutable vy: float; mutable vz: float; > mass : float; > } Advice from old FORTRAN hacker: This is a bad data structure for Ocaml. Try using an unboxed float array of 7 times the length instead, this will eliminate boxing, eliminate write barriers, eliminate garbage collection, reduce memory requirements. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net