RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter
Andrew Haley
aph at openjdk.org
Wed Jul 17 17:17:52 UTC 2024
On Thu, 11 Jul 2024 23:47:51 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> src/hotspot/share/oops/klass.cpp line 284:
>>
>>> 282: // which doesn't zero out the memory before calling the constructor.
>>> 283: Klass::Klass(KlassKind kind) : _kind(kind),
>>> 284: _bitmap(SECONDARY_SUPERS_BITMAP_FULL),
>>
>> I like the idea, but what are the benefits of initializing `_bitmap` separately from `_secondary_supers`?
>
> Another observation while browsing the code: `_secondary_supers_bitmap` would be a better name. (Same considerations apply to `_hash_slot`.)
This is because the C++ runtime does secondary super cache lookups even before the bitmap has been calculated and the hash table sorted. In this case the bitmap is zero, so teh search thinks there are no secondary supers. Setting _bitmap to SECONDARY_SUPERS_BITMAP_FULL forces a linear search.
I guess there might be a better way to do this. Perhaps a comment is needed?
I agree about `_secondary_supers_bitmap` name.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19989#discussion_r1681410651
More information about the core-libs-dev
mailing list