Dumb question: Hashtable sizes

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).

Anselm.

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