RFR : 8186517: sun.nio.cs.StandardCharsets$Aliases and ClassMap can be lazily loaded
claes.redestad at oracle.com
Fri Aug 25 18:39:47 UTC 2017
On 2017-08-25 19:59, Xueming Shen wrote:
> On 08/24/2017 01:00 PM, Claes Redestad wrote:
>> On 2017-08-24 20:06, Claes Redestad wrote:
>> 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.
> 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
> US_ASCII will still trigger the mapping loadup in
Right, this is something Peter prototyped a fix for elsewhere in this
thread, but that I
think we can leave for a follow-up. There's some complexity around
are added to the Cache, and we need to either add these as branches in
method or ensure that we can add them to the cache as instances are
created in a
thread-safe way (CHM).
> I doubt the "identity" still works here, does it? can CDS play the
> magic here?
String literals are interned, so identity works here even without them
constants (and I can verify the startup optimization to not run through
still in effect)
> Take a step back, it might be reasonable to consider to insert the
> 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 :-)
We'd have to load fewer methods - which would be a gain at some level
measure) - but we'd have to generate all the classes, or hard-code the
for the built-ins. There's also that icky SJIS / sun.nio.cs.map case.
Nothing insurmountable, but perhaps too little gain for the effort.
> 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.
More information about the nio-dev