4.0.0 JNI/reflection invocation 2/4/8 times as slow as in 3.3.3

Tom Tromey tromey@redhat.com
Sat Jan 22 23:11:00 GMT 2005

>>>>> "Jost" == Jost Boekemeier <jost2345@yahoo.de> writes:

Jost> -        table = new Object[old.length << 1 + 2];
Jost> +        table = new Object[(old.length * 2) + 2];
Jost> Imho the new implementation is nonsense.

The new implementation is really just the original reimplementation

Jost> This hash is not a "normal" hash table with a list but it is an array
Jost> where additional entries are stored above the current entry.  The
Jost> implementation requires that empty slots appear between the
Jost> keys/tombstones, otherwise the hash degenerates to a linear search.

Jost> So old.length << 2 could be a good value, or, as the original author
Jost> decided old.length << 3.

I don't follow why that would be better.  Could you elaborate on this?


More information about the Java mailing list