RFR: 8214712: Archive Attributes$Name.KNOWN_NAMES
David Holmes
david.holmes at oracle.com
Tue Dec 4 05:09:52 UTC 2018
Hi Claes,
Meta-comment: are these Names candidates for the forthcoming
compile-time evaluation of constants? Just wondering if these
optimizations (and even the archiving itself) will be moot in the future?
Thanks,
David
On 4/12/2018 2:02 am, Claes Redestad wrote:
> Hi,
>
> initializing java.util.jar.Attributes.Name.<clinit> executes ~20k
> bytecodes setting up and eagerly calculating case-insensitive hash codes
> for a slew of Name objects.
>
> By archiving the resulting set of Names and initializing public
> constants from the archived map, we reduce time spent starting up
> (Name.<clinit> drops to 368 executed bytecodes) and improve the
> footprint sharing effect of using CDS:
>
> http://cr.openjdk.java.net/~redestad/8214712/jdk.00/
>
> Testing: tier1-2 running
>
> Verified a 1-2.5ms startup improvement on java -jar Hello.jar
> - significant and stable reduction in instruction count, branches and
> branch misses
> - only adds ~1.1Kb to the dumped CDS archive
>
> Thanks!
>
> /Claes
More information about the core-libs-dev
mailing list