libgcj performance: _Jv_LookupInterfaceMethod

Tom Tromey tromey@cygnus.com
Wed Nov 17 23:16:00 GMT 1999


>>>>> "Kresten" == Kresten Krab Thorup <krab@daimi.au.dk> writes:

Kresten> I think that you should be using `%' and not `&' to limit the
Kresten> hash code to be in the method cache index range.

You're right.  Actually, I want to use "&" and require that the hash
table be the right length.  Ordinarily I don't micro-optimize like
this, but I think in this case it will pay off.

Kresten> The bug in the original code was (I believe), that I forgot
Kresten> to reset method_cache_count after it was cleaned out.  It
Kresten> should have been set back down to zero (in
Kresten> _Jv_AddMethodToCache).  My hunch is, that fixing this bug
Kresten> will make it perform better than what's there now.

I'm reluctant to introduce a loop here without data supporting it one
way or another.  It seems like it would only be useful when there are
many hash collisions.

Tom


More information about the Java mailing list