<i18n dev> RFR: 8261254: Initialize charset mapping data lazily

Claes Redestad redestad at openjdk.java.net
Mon Feb 8 11:33:46 UTC 2021


On Mon, 8 Feb 2021 08:36:21 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> This patch refactor JDK internal charsets to initialize charset mapping data lazily when needed via holder classes. This means both a startup improvement in some cases, and possible throughput improvements for all DoubleByte-based Charsets.
>> 
>> Testing: tier1-3
>
> I wouldn't expect enumerating all charsets with Charset::availableCharsets to be too common but moving the data to holder class looks okay. The missing "final" in a few places was an oversight.  The replacement of the foreach and method ref in getServicesCatalog with imperative code is disappointment but okay here.

I spotted usage of this in a real application. While they could work around it and remove the usage to gain an even larger startup win I figured I should do those that can't do so a favor, too.

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

PR: https://git.openjdk.java.net/jdk/pull/2449


More information about the i18n-dev mailing list