On Wed, 27 Aug 2025 19:40:28 GMT, Roger Riggs <rri...@openjdk.org> wrote:

> As observed in [JDK-8366043](https://bugs.openjdk.org/browse/JDK-8366043) 
> [lworld] (LIFE = Legacy Idiom For Equality) causes performance regressions.
> Updating HashMap and ConcurrentHashMap to use `java.util.Objects.equals` will 
> make it easier to measure performance of options that remove or modify the 
> use of `==`
> 
> Replace constructs like:
> 
> -                        ((k = e.key) == key || (key != null && 
> key.equals(k))))
> with:
> +                        Objects.equals(key, k))
> 
> 
> The changes in ConcurrentHashMap are a bit different due to the use of null 
> as a sentinel.
> 
> The order of arguments to the .equals methods must remain the same to ensure 
> compatibility.

I think my concerns are addressed so far.

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

Marked as reviewed by liach (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/1536#pullrequestreview-3180866440

Reply via email to