Using descriptor than internal name hashes for CP ClassEntry
-
liangchenblue at gmail.com
Sun Dec 24 16:11:23 UTC 2023
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/20231224/55e3cc60/attachment.htm>
More information about the classfile-api-dev
mailing list