Re: Speed of retrieving objects from Hastable
Posted By:
Michael_Wax
Posted On:
Tuesday, May 22, 2001 08:13 PM
The speed of the Java hashing algorithm for strings should be roughly proportional to the string length, so shorter keys will buy you some speed. However, I would guess that a small fraction of the processing time is spent on the hashing algorithm in a typical case. If you need speed, you could probably gain more by switching from a synchronized Hashtable to an unsynchronized HashMap, given the relatively long time that the synchronization process takes.