RFR: 8174831: Reduce number of Charset classes loaded on bootstrap

Claes Redestad claes.redestad at oracle.com
Mon Feb 13 19:26:54 UTC 2017

On 2017-02-13 20:12, Alan Bateman wrote:
> On 13/02/2017 19:03, Claes Redestad wrote:
>> Hi,
>> this patch addresses a few tiny startup regressions incurred mostly by
>> the fact that Compact Strings eagerly loads more Charsets early.
>> java.nio.charset.StandardCharsets is dropped from the early bootstrap,
>> load fastpaths are added for the 3 eagerly used Charsets (which avoids
>> some early reflection use), plus a couple of other nits:
>> Webrev: http://cr.openjdk.java.net/~redestad/8174831/webrev.01/
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8174831
>> Testing: jdk-tier1 tests
> One suggestion is to comment the `==` check in Charset.lookup as future
> maintainers may wonder why it doesn't use equals.

Sure, how about:

  // As all charset class names added to classMap are string literals
  // we can check identity here as an optimization


> -Alan.

More information about the core-libs-dev mailing list