RFR: 8358535: Changes in ClassValue (JDK-8351996) caused a 1-9% regression in Renaissance-PageRank
Aleksey Shipilev
shade at openjdk.org
Thu Aug 7 19:33:12 UTC 2025
On Thu, 7 Aug 2025 18:40:16 GMT, Chen Liang <liach at openjdk.org> wrote:
>> I think whenever we hit `readAccess`, it means we are missing this item in the cache and are already in this slow path. I pondered this may happen due to cache being too full too, in which case we have `updated == entry` in the backing map, so leaving it out of the if block should be correct.
>
> Also, this cache mechanism was authored before JDK 8 introduced fast table cache in `ConcurrentHashMap`. In the long run, we may switch the ClassValueMap to a ConcurrentHashMap-derived structure, like a `ReferencedKeyMap`.
Ah, OK, so this is already slow path, good. But are we sure overwriting cache entry _with (the live version of) itself_ would not break things? Looking at `addToCache` implemenation, I am not 100% convinced it is safe. Please check?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26679#discussion_r2261237490
More information about the core-libs-dev
mailing list