RFR [10]: 8186517: sun.nio.cs.StandardCharsets$Aliases and ClassMap can be lazily loaded
Xueming Shen
xueming.shen at oracle.com
Fri Aug 25 17:59:36 UTC 2017
On 08/24/2017 01:00 PM, Claes Redestad wrote:
>
>
> On 2017-08-24 20:06, Claes Redestad wrote:
>
>
> http://cr.openjdk.java.net/~redestad/8186517/jdk.03/
>
> Manually verified that generated charsets look correct and ran all charset tests without issue.
>
>>
>> Should be a nice reduction in retained objects on minimal apps.
>
> 425 fewer objects allocated, -16.5Kb.
>
> /Claes
Claes,
It might be worth adding the "instance" field for the utf-16/be/le as well? otherwise it
appears a reference to any of the java.nio.charset.StandardCharsets.UTF_8/ISO_8859_1/
US_ASCII will still trigger the mapping loadup in sun.nio.cs.StandardCharsets.
java.nio.charset.Charset.java:642
I doubt the "identity" still works here, does it? can CDS play the magic here?
Take a step back, it might be reasonable to consider to insert the "aliases_xyz"
into individual class directly instead of keeping them in provider ... not sure whether
or not it is worth though, I think we can leave it for next visit :-)
btw, there are some tests at closed test repo for sun/nio/cs need to be run as well. I should
bring them into openjdk when have time.
-Sherman
More information about the nio-dev
mailing list