Using descriptor than internal name hashes for CP ClassEntry
Adam Sotona
adam.sotona at oracle.com
Wed Jan 3 13:55:56 UTC 2024
Hi Chen,
It looks promising, do you have some benchmark numbers?
Thanks,
Adam
From: classfile-api-dev <classfile-api-dev-retn at openjdk.org> on behalf of liangchenblue at gmail.com <liangchenblue at gmail.com>
Date: Sunday, 24 December 2023 at 17:11
To: classfile-api-dev <classfile-api-dev at openjdk.org>
Subject: Using descriptor than internal name hashes for CP ClassEntry
Hi,
Since we are using ClassDesc quite often to represent Class constants in Class-File API, yet it's costly to hash them (as they are internal names in CP but descriptors in ClassDesc), that Adam has created shortcuts to speed up fetching of Object CE from CD_Object, I have thought of a new tactic to hash ClassEntry by full descriptor than by internal name alone.
I have made a prototype at https://github.com/liachmodded/jdk/commit/2932a560b0029352f1309883b3c5eecfb3d2c771
The idea is that hashing CE as descriptors is easier than creating substrings for hashing; substring hashing is hard to compute, but appending and prepending and hash is much easier.
Does this look like a good idea? I only included a test to confirm its correctness, but haven't got time to bench it against, say, the port of java.lang,invoke or ProxyGenerator.
Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20240103/7d66733c/attachment.htm>
More information about the classfile-api-dev
mailing list