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

Сергей Цыпанов github.com+10835776+stsypanov at openjdk.java.net
Mon Feb 8 12:50:41 UTC 2021

On Mon, 8 Feb 2021 12:16:23 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java line 75:
>>> 73: 
>>> 74:     protected AbstractCharsetProvider(String pkgPrefixName) {
>>> 75:         packagePrefix = pkgPrefixName.concat(".");
>> Hm, I wonder why not just `pkgPrefixName + '.'` here and below? Is it something about early init of `StringConcatFactory`?
> Yes, I wanted to measure the overhead of `Charset` class initialization done by `Charset.availableCharsets()` and the `StringConcatFactory` bootstraps was a reasonable chunk of the cost so I moved them out of the picture. I didn't mind what I ended up with, but if you prefer I can move back to `pkgPrefixName + '.'` here.

Let's keep it as is, to me it's a readable as concatenation via `+`


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

More information about the i18n-dev mailing list