[Investigation] Considering using a hashtable to store the signature handlers
Guoxiong Li
lgxbslgx at gmail.com
Sun Apr 9 15:02:55 UTC 2023
Hi all,
I notice these are two arrays `_fingerprints` and `_handlers` in class
`SignatureHandlerLibrary`[1]
which are used to store the addresses of the signature handler of the
native method.
But it seems not very efficient because the worst search time is O(N).
If the most recently created handlers are likely to be used mostly, their
search time will always be O(n),
because the recently created handlers are added to the end of the array
and the search begins from the first element of the array to the last
element.
So I want to use a hashtable instead of arrays to store the signature
handlers.
And the entry of such a hashtable at least contains the fingerprint and
address.
What is your opinion?
Any ideas are appreciated.
Best Regards.
-- Guoxiong
[1]
https://github.com/openjdk/jdk/blob/50d73352068f588cf6db29acb56e21b0412ab768/src/hotspot/share/interpreter/interpreterRuntime.hpp#L170
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20230409/ca0425a8/attachment.htm>
More information about the hotspot-dev
mailing list