Version française
Home     About     Download     Resources     Contact us    
Browse thread
[oliver: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jdh30@c...>
Subject: Re: [oliver: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys]
On Sunday 25 April 2004 7:54 pm, Marcin 'Qrczak' Kowalczyk wrote:
> W li¶cie z sob, 24-04-2004, godz. 05:46 +0100, Jon Harrop napisa³:
> > I don't want the overhead of hash tables carrying around and updating an
> > int.
>
> But it already does it! (to know when to rehash)

Another int, then. ;-)

In case anyone is interested, my peeve about carrying the length of a list 
around inside the list in the case of the STL came from my use of a data 
structure for molecular dynamics: The atomic structure is described by 
particle coordinates within a cubic box under periodic boundary conditions. 
Conventionally, the box is partitioned into voxels so that you can lookup 
neighbouring atoms efficiently. Each voxel contains a list of atoms within 
the voxel. I was often using ~10^6 voxels, so the STL list was carrying 4Mb 
of unecessary data with my data structure.

Thus, in the context of ocaml, I'd like to see "low-level" libraries which 
carry as little as possible. This isn't just for cache coherence but also 
because I think it is good design. If someone wants a Hashtbl which carries 
(and updates) baggage around with it to save you from having to record things 
yourself then they can create a "higher-level" implementation from the 
original. So, in summary, I like Hashtbl just the way it is... lean and 
mean. :-)

Cheers,
Jon.

PS: I tried to do the same thing in Mathematica but it can only pack the whole 
(4-dimensions of my) nested list into an array, or none of it. :(

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners