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 VAA24404; Mon, 5 Nov 2001 21:55:22 +0100 (MET) 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 VAA24391 for ; Mon, 5 Nov 2001 21:55:21 +0100 (MET) Received: from mail.mimuw.edu.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fA5KtFH25747 for ; Mon, 5 Nov 2001 21:55:17 +0100 (MET) Received: (from news@localhost) by mail.mimuw.edu.pl (PLD/8.9.3) id VAA23680 for caml-list@inria.fr; Mon, 5 Nov 2001 21:56:43 +0100 X-Authentication-Warning: qrnik.zagroda: news set sender to Marcin 'Qrczak' Kowalczyk using -f From: "Marcin 'Qrczak' Kowalczyk" Subject: Re: [Caml-list] Specialized dictionaries Date: Mon, 5 Nov 2001 20:56:40 +0000 (UTC) Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?= Message-ID: References: <15334.27347.973997.129488@pc803> <9s6j7c$i6r$1@qrnik.zagroda> <9s6m53$k16$1@qrnik.zagroda> X-Trace: qrnik.zagroda 1004993800 23459 192.168.0.1 (5 Nov 2001 20:56:40 GMT) X-Complaints-To: abuse@localhost NNTP-Posting-Date: Mon, 5 Nov 2001 20:56:40 +0000 (UTC) User-Agent: slrn/0.9.7.2 (Linux) To: caml-list@inria.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Mon, 5 Nov 2001 19:24:06 +0100, Nicolas George pisze: >> So updates are rare, dictionaries are >> small and they contain small integers, but lookups are very frequent. > > What about using a simple array for that? Then usually contain small integers, but theoretically these integers can go large. If many types are created in a program, then it would be wasteful to allocate large arrays for each dispatched function which uses a single type with a large number. Perhaps some heuristic could use an array for the initial segment of numbers (which correspond to types created earlier) and another dictionary for the rest, but it would complicate what is being done purely for fun and for being simple. More importantly, small differences such that loading modules in a different order could have large effects; I don't like treating old types and young types in a very different way. I've heard about packing multiple dispatch tables in a large array. Well, it's complicated, and it's hard to perform dynamic updates if slots are used by different functions. Updates are rare but they do occur - for example if a dispatched function is used at a type for the first time and the implementation was found at its supertype. I don't know... -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ QRCZAK ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr