RFR(M) 8234693 Consolidate CDS static and dynamic archive dumping code
Ioi Lam
ioi.lam at oracle.com
Sat Aug 1 06:36:58 UTC 2020
https://bugs.openjdk.java.net/browse/JDK-8234693
https://cr.openjdk.java.net/~iklam/jdk16/8234693-consolidate-static-dynamic-cds-dump.v01/
https://wiki.openjdk.java.net/display/HotSpot/How+CDS+Copies+Class+Metadata+into+the+Archive
Currently there are two very similar implementations for static CDS archive
dumping (metaspaceShared.cpp) and dynamic CDS archive dumping
(dynamicArchive.cpp).
I've merged the two versions and moved to a new file, archiveBuilder.cpp.
I also improved the copying algorithm to speed up dumping. Times for dumping
20000+ classes:
static dynamic
Old 42.655 sec 67.014 sec
New 37.027 sec 34.974 sec
Normally I would not try to optimize when refactoring code. I made an
earlier, naive attempt to use the old dynamic dumper for static dumping
(because dynamic dumping is essentially a superset of static dumping).
However, that caused significant regression in static dumping speed.
Hopefully the new algorithm is both faster and easier to understand.
Please see the wiki document for more information.
Tested with mach5 tiers 1-4.
Thanks
- Ioi
More information about the hotspot-runtime-dev
mailing list