From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 3161DBC6B for ; Thu, 29 Nov 2007 23:34:40 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAOvMTkfUnw6Flmdsb2JhbACCOY0GAgEBBwQGIgc X-IronPort-AV: E=Sophos;i="4.23,230,1194217200"; d="scan'208";a="5081325" Received: from pih-relay06.plus.net ([212.159.14.133]) by mail1-smtp-roc.national.inria.fr with ESMTP; 29 Nov 2007 23:34:39 +0100 Received: from [80.229.56.224] (helo=beast.local) by pih-relay06.plus.net with esmtp (Exim) id 1Ixrxv-0000Rx-0O for caml-list@yquem.inria.fr; Thu, 29 Nov 2007 22:34:39 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Help with simple ocaml memoization problem Date: Thu, 29 Nov 2007 22:25:32 +0000 User-Agent: KMail/1.9.5 References: <200711290811.29007.jon@ffconsultancy.com> <474E7F2B.6090007@lri.fr> In-Reply-To: <474E7F2B.6090007@lri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200711292225.33048.jon@ffconsultancy.com> X-Spam: no; 0.00; ocaml:01 memoization:01 filliatre:01 ocaml:01 stdlib:01 hash:01 frog:98 wrote:01 wrote:01 caml-list:01 imperative:01 data:02 data:02 inefficient:02 structures:02 On Thursday 29 November 2007 08:58, Jean-Christophe Filli=E2tre wrote: > Jon Harrop wrote: > > The Map implementation in the OCaml stdlib is also quite inefficient. I > > did a little benchmark once and discovered that Maps actually waste more > > space than Hashtbls. > > I find it unfair to compare an imperative and a persistence data > structure for performances. Of course you are going to use some extra > space if you need to keep old versions of the data stuctures valid. > But you are sharing *a lot* among the various versions. So if you are > manipulating several sets/maps with common ancestors at the same time, > you are saving memory w.r.t. other data structures such as hash tables. Incidentally, what are the pedagogical applications of shared maps? =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e