From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1C3ECBC48 for ; Fri, 22 Apr 2005 08:12:40 +0200 (CEST) Received: from smtp.syd.swiftdsl.com.au (smtp.syd.swiftdsl.com.au [218.214.224.138]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j3M6CYux030075 for ; Fri, 22 Apr 2005 08:12:39 +0200 Received: (qmail 23933 invoked from network); 22 Apr 2005 06:12:43 -0000 Received: from unknown (HELO coltrane.mega-nerd.net) (218.214.64.136) by smtp.syd.swiftdsl.com.au with SMTP; 22 Apr 2005 06:12:43 -0000 Received: from coltrane (localhost [127.0.0.1]) by coltrane.mega-nerd.net (Postfix) with SMTP id BD9F47BBB for ; Fri, 22 Apr 2005 13:21:31 +1000 (EST) Date: Fri, 22 Apr 2005 13:21:31 +1000 From: Erik de Castro Lopo To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Hashtbl.create 401 Message-Id: <20050422132131.6ff2fbee.ocaml-erikd@mega-nerd.com> In-Reply-To: <42686ADE.1040406@havenrock.com> References: <42686ADE.1040406@havenrock.com> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 426895D2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hashtbl:01 labltk:01 hashtbl:01 hash:01 hash:01 nospam:98 wrote:01 alan:01 data:02 data:02 instances:02 perhaps:03 erik:04 erik:04 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none 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. 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