From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA17851; Sun, 25 Apr 2004 22:10:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA18911 for ; Sun, 25 Apr 2004 22:10:28 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3PKARjq021455 for ; Sun, 25 Apr 2004 22:10:27 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1BHpxL-0007GZ-Eq for caml-list@inria.fr; Sun, 25 Apr 2004 20:10:27 +0000 From: Jon Harrop Organization: University of Cambridge To: caml-list Subject: Re: [oliver: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys] Date: Sun, 25 Apr 2004 21:06:33 +0100 User-Agent: KMail/1.5.4 References: <20040423200923.GA271@first.in-berlin.de> <200404240546.17082.jdh30@cam.ac.uk> <1082919271.3944.0.camel@qrnik> In-Reply-To: <1082919271.3944.0.camel@qrnik> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200404252106.34024.jdh30@cam.ac.uk> X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; oliver:01 caml-list:01 hashtbl:01 2004:99 marcin:01 'qrczak':01 kowalczyk:01 hash:01 partitioned:01 atoms:01 atoms:01 low-level:01 hashtbl:01 higher-level:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 25 April 2004 7:54 pm, Marcin 'Qrczak' Kowalczyk wrote: > W li=B6cie z sob, 24-04-2004, godz. 05:46 +0100, Jon Harrop napisa=B3: > > 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= =20 around inside the list in the case of the STL came from my use of a data=20 structure for molecular dynamics: The atomic structure is described by=20 particle coordinates within a cubic box under periodic boundary conditions.= =20 Conventionally, the box is partitioned into voxels so that you can lookup=20 neighbouring atoms efficiently. Each voxel contains a list of atoms within= =20 the voxel. I was often using ~10^6 voxels, so the STL list was carrying 4Mb= =20 of unecessary data with my data structure. Thus, in the context of ocaml, I'd like to see "low-level" libraries which= =20 carry as little as possible. This isn't just for cache coherence but also=20 because I think it is good design. If someone wants a Hashtbl which carries= =20 (and updates) baggage around with it to save you from having to record thin= gs=20 yourself then they can create a "higher-level" implementation from the=20 original. So, in summary, I like Hashtbl just the way it is... lean and=20 mean. :-) Cheers, Jon. PS: I tried to do the same thing in Mathematica but it can only pack the wh= ole=20 (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