RFR [10]: 8186517: sun.nio.cs.StandardCharsets$Aliases and ClassMap can be lazily loaded
Ulf Zibis
Ulf.Zibis at CoSoCo.de
Thu Aug 24 11:57:27 UTC 2017
Am 24.08.2017 um 00:13 schrieb Claes Redestad:
>
> On 2017-08-23 23:21, Xueming Shen wrote:
>> if we go that far :-) shouldn't we simply expose the
>> utf8/8859-1/ascii charset
>> instance directly?
>
> Why not. If we went as far as to putting them in
> java.nio.charset.Charset instead,
> we'd not even load sun...StandardCharsets during typical bootstrap,
> which would
> of course make things even better for startup.
+1
And then you could direktly cache the pre-instantiated classes via an
extended constructor of Cache:
96 if (map == null) {
97 cache = map = new Cache(Charset.ASCII, Charset.ISO_8859_1,
Charset.UTF_8);
98 }
-Ulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170824/2512b334/attachment.html>
More information about the nio-dev
mailing list