-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix PackageGraph
traversal performance regressions
#7248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci test |
The actual fix is also verified by |
Currently blocked due to #7249 |
This restores the performance of traversal of deep package graphs previously available when `ResolvedTarget`, `ResolvedProduct`, and `ResolvedPackage` were value types. Now instead of recursively applying `Hashable` conformance to all properties in graph's node, we only hash and compare for equality their identities. The main benefit of this approach is that build triple of `ResolvedProduct` and `ResolvedTarget` is now a part of their identity. Thus we can still use value types, while the same `Target` from `PackageModel` instantiated as two different `ResolvedTarget`s with different `BuildTriples` will have different identities. Resolves rdar://120861833 Resolves rdar://120711211
e9ede20
to
98fd47f
Compare
@swift-ci test |
@swift-ci test |
`ResolvedTarget` is no longer `Hashable` in SwiftPM, SourceKit-LSP should use `ResolvedTarget.ID` instead. Depends on swiftlang/swift-package-manager#7248.
@swift-ci test windows |
1 similar comment
@swift-ci test windows |
`ResolvedTarget` is no longer `Hashable` in SwiftPM, SourceKit-LSP should use `ResolvedTarget.ID` instead. Depends on swiftlang/swift-package-manager#7248.
Depends on #7258
This restores performance of traversal of deep package graphs previously available when
ResolvedTarget
,ResolvedProduct
, andResolvedPackage
were reference types. Now instead of recursively applyingHashable
andEquatable
conformances to all properties in graph's node, we only hash and compare for equality their identities defined byIdentifiable
.Uses of
Set
on these types are now replaced with the newIdentifiableSet
type, which uses a dictionary of[Element.ID: Element]
type as its storage.The main benefit of this approach is that build triple of
ResolvedProduct
andResolvedTarget
is now a part of their identity. Thus we can still use value types, while the sameTarget
fromPackageModel
instantiated as two differentResolvedTarget
s with differentBuildTriples
will have different identities.Resolves rdar://120861833
Resolves rdar://120711211