RFR: 8221836: Avoid recalculating String.hash when zero

Aleksey Shipilev shade at redhat.com
Mon Apr 8 11:12:39 UTC 2019

On 4/8/19 1:00 PM, Claes Redestad wrote:
> On 2019-04-08 12:28, Aleksey Shipilev wrote:
>> Because the whole thing in current code is "benign data race" on hash field. Pulling in another
>> field into race needs careful consideration if it breaks the benignity. It apparently does not, but
>> the cognitive complexity involved in reading that code makes the minuscule benefit much more
>> questionable.
> Can some carefully worded comments in the vicinity ease your concern?

No. I am against deviating from the benign data race template, for either current or future changes,
without the clearly overwhelming benefit of doing so. We have enough bugs as it is to risk exposing
more bugs for the cases where the benefit is non-compelling. Therefore, my concern would be
alleviated if we don't do this change at all.


More information about the core-libs-dev mailing list