|Re: [equinox-dev] StateHelperImpl.getExportedPackageMap: map/set initial capacity|
Bug 335279 was created:
Please open a bug and supply a patch with a suggested improvement.
-----equinox-dev-bounces@xxxxxxxxxxx wrote: -----
To: "equinox-dev@xxxxxxxxxxx" <equinox-dev@xxxxxxxxxxx>
I am writing with regards to method “org.eclipse.osgi.internal.resolver.StateHelperImpl.getExportedPackageMap”, which constructs Map and Set with initial capacity. Is there a particular reason for constructing them in that way?
Map<String, Set<ExportPackageDescription>> result = new HashMap<String, Set<ExportPackageDescription>>(11);
exports = new HashSet<ExportPackageDescription>(1);
IMHO, in most cases, it causes array resizing, which, I saw, reflects to performance analysis.