caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Importance of weak hash tables initial size ?
@ 2006-11-11 20:31 Pierre Etchemaïté
  0 siblings, 0 replies; only message in thread
From: Pierre Etchemaïté @ 2006-11-11 20:31 UTC (permalink / raw)
  To: caml-list


	Hi all,

I noticed that while the initial size of regular hash tables does not
matter too much for performance (beside the cost of additional resizes
and elements rehashing to reach the final size), creating weak hash
tables with a small initial size leads to a weak hash table with a
much higher load factor than the same program with a larger initial
hash table size.

For short, large weak hash tables have a significantly worse access
time performance when created with a small initial size.

Specifically, what is the rationale behind the

  t.limit <- t.limit + 2

in weak.ml ?

It may be ok to use a higher load factor than Hashtbl (who uses a
constant limit of 2), since there's some overallocation going on in
each bucket of weak hash tables, but I fail to understand why the load
factor limit should also be raised with each resizing...

Best regards,
Pierre.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-11 20:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-11 20:31 Importance of weak hash tables initial size ? Pierre Etchemaïté

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).