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

Dumb question: Hashtable sizes

From: Dave Makower <davemak@pencom.com>
Date: Tue, 17 Sep 1996 14:33:47 -0400 (EDT)
Message-Id: <v01540b04ae646490c567@[199.171.199.246]>
To: www-jigsaw@w3.org
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?



+---------------------+-------------------------+---------------------+
|    Dave Makower     |    davemak@pencom.com   |   WWW Specialist    |
+---------------------+-------------------------+---------------------+
|     Co-author of "Java Programming Basics" (Henry Holt/MIS:Press)   |
|                 http://www.pencom.com/javabasics/                   |
+----------------------------------+----------------------------------+
|   Pencom Web Works               |   (212) 513-7777   voice         |
|   Pencom Systems Inc.            |   (212) 513-1975   fax           |
|   40 Fulton St.                  |                                  |
|   New York, NY  10038            |   http://www.pencom.com/         |
+----------------------------------+----------------------------------+
Received on Tuesday, 17 September 1996 14:33:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT