RFR: 8266642: improve ResolvedMethodTable hash function [v5]
Coleen Phillimore
coleenp at openjdk.java.net
Wed May 12 16:22:21 UTC 2021
On Wed, 12 May 2021 11:14:25 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> JDK-8249719 has fixed the bad hash function problem, however, the performance problem still exists when there are a large number of classes with the same name.
>> Adding the address of the corresponding ClassLoaderData as a factor of hash can solve the problem.
>
> Denghui Dong has updated the pull request incrementally with one additional commit since the last revision:
>
> update the implementation
src/hotspot/share/prims/resolvedMethodTable.cpp line 59:
> 57: hash = (hash * 31) ^ method->name()->identity_hash();
> 58: hash = (hash * 31) ^ method->signature()->identity_hash();
> 59: return hash ^ (unsigned)((uintptr_t)method >> (LogMinObjAlignmentInBytes + 3));
I agree with Vladimir that it makes sense to improve the hashing function of the ResolvedMethodTable for the special case of names matching. You have to use the ClassLoaderData though, not the Method* because the reason for the table is to replace Method* in the case of redefinition.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3901
More information about the hotspot-runtime-dev
mailing list