Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Benchmark] NBody
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Will M. Farr <farr@M...>
Subject: Re: [Caml-list] [Benchmark] NBody
Doesn't caml store records whose types are all floats as a float array 
anyway?  I thought I remembered this optimization going by in the 
manual somewhere.

Will


On 7 Feb 2005, at 8:29 PM, skaller wrote:

> 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
>
>
>
> _______________________________________________
> 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