<i18n dev> RFR: 8288723: Avoid redundant ConcurrentHashMap.get call in java.time [v2]

Andrey Turbanov aturbanov at openjdk.org
Mon Jul 4 07:06:30 UTC 2022


On Sun, 3 Jul 2022 19:44:55 GMT, Attila Szegedi <attila at openjdk.org> wrote:

>> But it will generate garbage: non-static lambda.
>
> It already generates some garbage as it does string concatenation for the key. Here's an idea: declare a record class for the key, `record CacheKey(DayOfWeek firstDayOfWeek, int minimalDaysInFirstWeek)`. It will be more efficient than using strings for keys, and then you can have a static lambda.

done

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

PR: https://git.openjdk.org/jdk/pull/9208


More information about the i18n-dev mailing list