RFR: 8266015: Implement AdapterHandlerLibrary lookup fast-path for common adapters [v3]

Claes Redestad redestad at openjdk.java.net
Fri Apr 30 19:04:57 UTC 2021


On Thu, 29 Apr 2021 04:49:30 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use a SignatureIterator to calculate the sig_bt array to allow taking advantage of the method fingerprint
>
> Looks good overall, but I think we should avoid changing the `return NULL` to `fatal()`.
> 
> Also note to other reviewers: when looking at the "Files changed", add `&w=1` to the URL so GitHub will ignore whitespace changes.

@iklam asked me offline to experiment using a concurrent hash table keyed on fingerprint to create a quick filter. I've done a few prototypes and verified that a concurrent hash table alone[1] does perform roughly as well as this patch on a few sampled applications, and that combining the current patch with a concurrent hash table comes out slightly ahead of both[2]. But this comes at a cost of an additional data structure that might grow to non-trivial size.

After analyzing the most significant part of the difference comes not from a reduction in `Mutex` overhead (~400k insts) but from a reduction in `SignatureStream` parsing (~1.2M insns). Using a `SignatureIterator` that takes the method fingerprint into account gets us ahead of the combined `ConcurrentHashTable` experiment, without needing to add another data structure. 

For a follow-up to this it might make sense to re-implement `AdapterHandlerLibrary::_adapters` as a `ConcurrentHashTable`  rather than a `BasicHashtable`.

[1] https://github.com/openjdk/jdk/compare/master...cl4es:adapter_cht_only?expand=1
[2] https://github.com/openjdk/jdk/compare/master...cl4es:adapter_cht_combined?expand=1

-------------

PR: https://git.openjdk.java.net/jdk/pull/3706


More information about the hotspot-runtime-dev mailing list