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: padiolea@i...
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.

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
>