Version française
Home     About     Download     Resources     Contact us    
Browse thread
Hashtbl.create 401
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: [Caml-list] Hashtbl.create 401
On Thu, 21 Apr 2005 21:09:18 -0600
Matt Gushee <mgushee@havenrock.com> 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