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 UAA16611; Thu, 1 Jul 2004 20:13:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 UAA16564 for ; Thu, 1 Jul 2004 20:13:14 +0200 (MET DST) Received: from alex.baretta.com ([213.255.109.130]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i61IDCSH009508 for ; Thu, 1 Jul 2004 20:13:13 +0200 Received: from baretta.com (localhost [127.0.0.1]) by alex.baretta.com (Postfix) with ESMTP id 496D12D5ADA; Thu, 1 Jul 2004 14:14:07 -0400 (EDT) Message-ID: <40E4546E.70005@baretta.com> Date: Thu, 01 Jul 2004 20:14:06 +0200 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: Jan Kybic Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Re: Q: automatic forgetting cache, module Weak, Gc control References: <20040701.174358.116814367.garrigue@kurims.kyoto-u.ac.jp> <1088690342.2582.122.camel@pelican.wigram> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40E45438.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 disadvantage:01 hashtables:01 hashtables:01 tradeoff:01 memoize:01 generic:01 hashes:01 hashing:01 hash:01 alex:01 alex:01 module:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jan Kybic wrote: > I am also thinking about other strategies taking into account the > sizes of the produced results. In this case the global structure would > be an ordered set. > > The disadvantage of putting the values into two structures is the > memory overhead. Maybe I should avoid using Weak hashtables > alltogether and store the values in a set of normal hashtables, > dropping some of them, if necessary... It is difficult to get the > memory/speed tradeoff right. You can memoize your results in a generic manner through the use of maps which use result hashes as keys. Two results hashing down to the same value will not be stored in the same map. The number of significant bits used by the hash function determines the size of the map. Alex ------------------- 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