This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Speeding up method searches
Bryce McKinlay <bryce@albatross.co.nz> writes:
> I would say that Interning should be as fast as possible if we are going
> to be calling it on every method name and signature of every initialized
> class.
Since this only happens when a class is initialized, speed is
important but perhaps not that critical. I'm even more concerned
about space. Using a general Hashtable is wsteful in terms of space:
Each entry in the hashtable has both a key and a value. In the intern
table, the key and the value are the same. Thus using a Hashtable
would waste *at least* one pointer field for each interned String.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/