<i18n dev> RFR: 8261254: Initialize charset mapping data lazily
Claes Redestad
redestad at openjdk.java.net
Mon Feb 8 12:21:42 UTC 2021
On Sun, 7 Feb 2021 19:44:41 GMT, Johannes Kuhn <jkuhn 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
>
> src/java.base/share/classes/java/lang/ModuleLayer.java line 936:
>
>> 934: for (Module m : nameToModule.values()) {
>> 935: servicesCatalog.register(m);
>> 936: }
>
> Seems to be unrelated, but it's not a bad change.
As with the `StringConcatFactory` changes @stsypanov commented on, I did this to reduce noise when zooming in on the cost of `Charset` class initialization stemming from `Charset.availableCharsets()`. I ended up preferring the desugared version, so I left it in.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2449
More information about the i18n-dev
mailing list