libgcj performance: _Jv_LookupInterfaceMethod

Kresten Krab Thorup krab@daimi.au.dk
Wed Nov 17 07:22:00 GMT 1999


So,

I think that you should be using `%' and not `&' to limit the hash
code to be in the method cache index range.  Using `&' only makes
sense if the range is a power of two (minus one).

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

At the very least, try replacing the `&' with `%'.  

-- Kresten

 Kresten Krab Thorup           "I like my eggs ploded"
 Department of Computer Science, University of Aarhus
 Aabogade 34, DK-8200 Aarhus N, Denmark
 +45 8942 5665 (office), +45 2343 4626 (mobile)


More information about the Java mailing list