From: "Pierre Etchemaïté" <petchema@concept-micro.com>
To: caml-list@yquem.inria.fr
Subject: Importance of weak hash tables initial size ?
Date: Sat, 11 Nov 2006 21:31:29 +0100 [thread overview]
Message-ID: <20061111213129.5855c21b.petchema@concept-micro.com> (raw)
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.
reply other threads:[~2006-11-11 20:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061111213129.5855c21b.petchema@concept-micro.com \
--to=petchema@concept-micro.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox