Create all mutable Ivy module resolve metadata through factoryThis will simplify the injection of services through the factory, when we will need the immutableattributes factory to be pushed to resolve metadata.
Cache module version identifiersIn a similar way to module identifiers, use the module identifier factory to cache the module version identifiers.It allows faster comparisons as we will hit `a==b` much more often and don't have to go the `equals` route. Thereare still places where the factory is not used, but it doesn't seem to have a huge impact on performance.
Revert De-duplicate commonly used immutable objects in dependency resolution and IDE changesCommits reverted:- 807b1e4f8d1585d93c1de3e9ca83d99d0819e2d2- 9482b0b05374253cafdb776550d7016385912e04- 4ecead06b53ec6b0f15c517bf0d0c6a74c3b3c05- db1135a8a5f1c507e0df3c03ad12ddc963799e4d- 7350bcbae30a777909cec74ebfd5a91d2c89081eAdditionally, minor changes to avoid usage of introducedclasses and methods from subsequent commits.Issue: gradle/gradle-private#563
De-duplicate (= intern) some instances in dependency resolution- Reduce memory usage of dependency resolution by de-duplicating the most commonly used immutable instances.- Objects aren't strictly immutable: displayName is calculated lazily - solution is thread-safe without synchronization - lazy calculation is needed for efficient interning since a lookup will always create a new instance.- Use strong references in some instance interners - strong references cause less GC overhead than weak references- Strong references: DefaultModuleIdentifier DefaultModuleVersionIdentifier DefaultModuleVersionSelector DefaultModuleComponentIdentifier DefaultModuleComponentSelector DefaultProjectComponentSelector- Weak references: DefaultLibraryBinaryIdentifier DefaultLibraryComponentSelector DefaultIvyArtifactName- Both reference types: DefaultBuildIdentifier DefaultProjectComponentIdentifier - The reason for special handing is that DefaultBuildIdentifier has a state field "current" as part of the instance which isn't part of equals/hashCode.+review REVIEW-6277