RFR(M) 8250990 Consolidate object copying code for CDS static/dynamic archive dumping
Ioi Lam
ioi.lam at oracle.com
Mon Aug 3 22:11:18 UTC 2020
There turns out to be a lot of duplication in the static/dynamic dumping
code. To keep the changes manageable, I've reorganized the REF into a
few sub-tasks. This particular review is for:
https://bugs.openjdk.java.net/browse/JDK-8250990
http://cr.openjdk.java.net/~iklam/jdk16/8250990-consolidate-static-dynamic-cds-objcopy.v01/
https://wiki.openjdk.java.net/display/HotSpot/How+CDS+Copies+Class+Metadata+into+the+Archive
I've also updated the e-mail subject to use the new JBS ID (JDK-8250990).
This patch is an intermediate step. Some code might look like they are
in the wrong place -- for example: _estimated_metsapceobj_bytes has been
moved to archiveBuilder.hpp, but _estimated_hashtable_bytes is still in
dynamicArchive.cpp. The latter will eventually be moved as part of the
second step (JDK-8250989
Consolidate buffer allocation code for CDS static/dynamic archive dumping).
(Coleen has given me feedback off-line. I'll post a new version soon to
limit the API in archiveBuilder.hpp)
Thanks
- Ioi
On 7/31/20 11:36 PM, Ioi Lam wrote:
>
> 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