Discussion:
RFR: 8214858: Improve module graph archiving
(too old to reply)
Alan Bateman
2018-12-06 08:56:35 UTC
Permalink
Hi,
- archive an instance of ArchiveModuleGraph rather than individual fields
- archiving the exportedPackagesToOpen and concealedPackagesToOpen
maps improve sharing and substantially reduce bytecode executed (~30k)
- archiving the remaining flags in the ArchivedModuleGraph means we no
longer need to archive SystemModules
  - this means we no longer load jdk.internal.module.SystemModules and
jdk.internal.module.SystemModules$default at runtime
- for robustness ensure we either resolve either everything or nothing
from the archive (there are some overlapping safeguards here, e.g.,
CDS is disabled when you run with --limit-modules, but helps to be
explicit)
Bugs: https://bugs.openjdk.java.net/browse/JDK-8214858
Webrev: http://cr.openjdk.java.net/~redestad/8214858/jdk.00/
Testing: tier1-3, locally tested all module and CDS tests
Startup tests verify a small speedup on my test setups (around -0.5ms
on average)
I think these changes look okay.

Once we get to the point of not permitting illegal access by default
then we might look at this again as the concealed/exported maps won't be
needed for the default case.

-Alan
Claes Redestad
2018-12-06 12:03:22 UTC
Permalink
Jiangli, Alan,

thanks for reviewing!
Post by Alan Bateman
Hi,
- archive an instance of ArchiveModuleGraph rather than individual fields
- archiving the exportedPackagesToOpen and concealedPackagesToOpen
maps improve sharing and substantially reduce bytecode executed (~30k)
- archiving the remaining flags in the ArchivedModuleGraph means we
no longer need to archive SystemModules
  - this means we no longer load jdk.internal.module.SystemModules
and jdk.internal.module.SystemModules$default at runtime
- for robustness ensure we either resolve either everything or
nothing from the archive (there are some overlapping safeguards here,
e.g., CDS is disabled when you run with --limit-modules, but helps to
be explicit)
Bugs: https://bugs.openjdk.java.net/browse/JDK-8214858
Webrev: http://cr.openjdk.java.net/~redestad/8214858/jdk.00/
Testing: tier1-3, locally tested all module and CDS tests
Startup tests verify a small speedup on my test setups (around -0.5ms
on average)
I think these changes look okay.
Once we get to the point of not permitting illegal access by default
then we might look at this again as the concealed/exported maps won't
be needed for the default case.
Yes, I can think of a few ways to simplify once --illegal-access=deny
becomes default (and either way that will be beneficial to startup time).

/Claes

Loading...