RFR: 8171373: Reduce copying during initialization of ModuleHashes

Mandy Chung mandy.chung at oracle.com
Fri Dec 16 17:52:21 UTC 2016

> On Dec 16, 2016, at 8:00 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> Hi,
> recent changes to split out ModuleHashes from ModuleDescriptor caused a small/tiny increase in HashMap creation, resize and copying:
> Webrev: http://cr.openjdk.java.net/~redestad/8171373/webrev.01/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8171373

I like the optimization for one single module (i.e. java.base) containing the module hashes which is the common case.

Can you add a comment in SystemModuleFinder about the common case and avoid creating a new HashMap unless there is more than one module containing ModuleHashes.

Builder::nameToHash can now be final.


More information about the jigsaw-dev mailing list