From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 4B5E4BC84 for ; Fri, 22 Apr 2005 14:06:48 +0200 (CEST) Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3MC6m5T012274 for ; Fri, 22 Apr 2005 14:06:48 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id E2525FAC7; Fri, 22 Apr 2005 14:06:47 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22092-01; Fri, 22 Apr 2005 14:06:45 +0200 (CEST) Received: from mail.irisa.fr (melo.irisa.fr [131.254.254.28]) by smtp.irisa.fr (Postfix) with ESMTP id E53D7FA9D; Fri, 22 Apr 2005 14:06:44 +0200 (CEST) Received: from 131.254.50.45 (SquirrelMail authenticated user padiolea) by mail.irisa.fr with HTTP; Fri, 22 Apr 2005 14:06:44 +0200 (CEST) Message-ID: <40833.131.254.50.45.1114171604.squirrel@mail.irisa.fr> In-Reply-To: <20050422132131.6ff2fbee.ocaml-erikd@mega-nerd.com> References: <42686ADE.1040406@havenrock.com> <20050422132131.6ff2fbee.ocaml-erikd@mega-nerd.com> Date: Fri, 22 Apr 2005 14:06:44 +0200 (CEST) Subject: Re: [Caml-list] Hashtbl.create 401 From: padiolea@irisa.fr To: "Erik de Castro Lopo" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at nez-perce with ID 4268E8D8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hashtbl:01 irisa:01 labltk:01 hashtbl:01 hash:01 hash:01 hashing:01 resize:01 caml-list:01 beginner's:01 ocaml:01 beginners:01 bug:01 nospam:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: > On Thu, 21 Apr 2005 21:09:18 -0600 > Matt Gushee wrote: > >> Hello, all-- >> >> While browsing through the Labltk source code (and perhaps in some other >> places), I noticed several instances of: >> >> Hashtbl.create 401 >> >> Why 401? > > Hash tables distribute data across a set of hash buckets. If > the number of hash buckets is prime (401 is prime) then their > is a better chance of the data being evenly distributed across > the buckets. but it seems that this number is not that much important since, as said in the ml source: (* We do dynamic hashing, and resize the table and rehash the elements when buckets become too long. *) > > Erik > -- > +-----------------------------------------------------------+ > Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) > +-----------------------------------------------------------+ > "I invented the term Object-Oriented, and I can tell you I > did not have C++ in mind." -- Alan Kay > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >