From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6SCPYGQ004159 for ; Thu, 28 Jul 2011 14:25:34 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukIAA9UMU7D3J8k/2dsb2JhbAA0AQEEAS1dDAxSFB00HphMjwp3iHwCwXWGQQSjXw X-IronPort-AV: E=Sophos;i="4.67,282,1309730400"; d="scan'208";a="114320900" Received: from imss-1.enac.fr ([195.220.159.36]) by mail1-smtp-roc.national.inria.fr with ESMTP; 28 Jul 2011 14:25:32 +0200 Received: from mauve.recherche.enac.fr (imss-1.imss.interne.enac [127.0.0.1]) by imss-1.enac.fr (Postfix) with ESMTP id C551C18B3A2 for ; Thu, 28 Jul 2011 14:25:29 +0200 (CEST) Received: from recherche.enac.fr (web.recherche.enac.fr [10.31.3.3]) by mauve.recherche.enac.fr (Postfix) with ESMTP id 8F57FC40054 for ; Thu, 28 Jul 2011 14:25:29 +0200 (CEST) Received: by recherche.enac.fr (Postfix, from userid 33) id 4592363738; Thu, 28 Jul 2011 14:25:29 +0200 (CEST) Received: from pendu.tls.cena.fr (pendu.tls.cena.fr [10.192.33.238]) by www.recherche.enac.fr (Horde MIME library) with HTTP; Thu, 28 Jul 2011 14:25:29 +0200 Message-ID: <20110728142529.ksntzfow5wo84404@www.recherche.enac.fr> Date: Thu, 28 Jul 2011 14:25:29 +0200 From: barnier@recherche.enac.fr To: caml-list@inria.fr References: <4E307DFE.3040502@gmail.com> <4E313071.7090309@inria.fr> In-Reply-To: <4E313071.7090309@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) Subject: Re: [Caml-list] Hashtbl performance Quoting Fabrice Le Fessant : > Thus, you should consider using your own hash function, probably only > considering the ints in the list and its length. Then, use the functor > in the Hashtbl module. You could also use the hash_param : int -> int -> 'a -> int function in the functor which allows to specify the number of nodes traversed to compute the key : # let list = ref [];; for i = 1 to 30 do list := i :: !list; Printf.printf "%d " (Hashtbl.hash_param 50 50 !list) done ;; 1 65601 8392706 797307010 578301955 731304131 182476804 222011652 582000645 696017221 383840262 291574150 409554951 301052359 474071048 875971080 459423753 1026998857 314757130 771437194 56324107 59478731 841228300 921690892 921690892 841228300 59478731 56324107 771437194 314757130 - : unit = () -- Nicolas Barnier ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.