Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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

    • -2
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 104 more files in changeset.
Added `BuildIdentity` service

- Provides the `BuildIdentifier` for the current build

- Used when constructing `ProjectComponentIdentifier` for project

Note that this service is still relying on the `CurrentBuildIdentifier` implementation.

    • -4
    • +10
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 6 more files in changeset.
Always use factory method to create ProjectComponentId

    • -2
    • +3
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 24 more files in changeset.
Merge Module and ModuleInternal as both are internal

    • -3
    • +3
    ./DefaultComponentIdentifierFactoryTest.groovy
  1. … 26 more files in changeset.
Moved some meta-data types out of org.gradle.api.internal.artifacts to org.gradle.internal.component, and split up into base, local and external types.

    • -0
    • +2
    ./DefaultComponentIdentifierFactoryTest.groovy
    • -58
    • +0
    ./DefaultComponentSpecIdentifierTest.groovy
    • -91
    • +0
    ./DefaultComponentSpecSelectorTest.groovy
    • -81
    • +0
    ./DefaultModuleComponentIdentifierTest.groovy
    • -117
    • +0
    ./DefaultModuleComponentSelectorTest.groovy
    • -60
    • +0
    ./OpaqueComponentIdentifierTest.groovy
  1. … 302 more files in changeset.
Renamed subprojects/core-impl to subprojects/dependency-management.

    • -0
    • +53
    ./DefaultComponentIdentifierFactoryTest.groovy
    • -0
    • +58
    ./DefaultComponentSpecIdentifierTest.groovy
    • -0
    • +91
    ./DefaultComponentSpecSelectorTest.groovy
    • -0
    • +81
    ./DefaultModuleComponentIdentifierTest.groovy
    • -0
    • +117
    ./DefaultModuleComponentSelectorTest.groovy
    • -0
    • +60
    ./OpaqueComponentIdentifierTest.groovy
  1. … 1379 more files in changeset.