W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1996

Dumb question: Hashtable sizes

From: Anselm Baird-Smith <abaird@w3.org>
Date: Tue, 17 Sep 1996 15:33:57 +0500
Message-Id: <9609171933.AA19951@www18.w3.org>
To: Dave Makower <davemak@pencom.com>
Cc: www-jigsaw@w3.org
Dave Makower writes:
 > Okay, here's a dumb one.
 > I notice in the Jigsaw code that when you're getting ready to initialize a
 > resource, or call indexer.createResource(), you initialize a Hashtable with
 > an explicit initial size.  But where does this size come from?  It would
 > make sense to me if you declared a Hashtable of size 10 and then put 10
 > things in it, but you always seem to specifically declare a Hashtable that
 > is at least twice as many slots as you need.  Does it have to do with
 > inherited attributes, or is it some optimal function of the number of
 > things you're putting in?

The default size for hashtable is 101, far too big to hold a couple
(less then 10) relations, that's why I am using the initialCapacity
argument (a kind of optimization, if you will).

Received on Tuesday, 17 September 1996 15:34:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:30 UTC