Skip to content

[5.6] dependency resolution performance (#4007) #4012

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

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jan 13, 2022

5.6 cherry pick of #4007

Explanation:

Fixed dependency resolution issues causing failure on edge cases such with pre-release versions. as a result of that fix, the bounds computation done as part of the resolution is no longer requires which removes a significant performance bottleneck. this PR removes the bounds computation yielding 3x performance improvement on medium to large projects.

The bounds computation was originally added in aee02eb in an attempt to improve diagnostics when graph fail to be resolve. #3985 changes how the underlying data for these diagnostics is captured which yield even better diagnostics. as such this PR is purely about performance gain by not running that expensive calculation any more since it no longer has any functional value.

Scope of Issue:

This impacts the performance of package dependency resolution, triggered by swift package update or when loading the package in Xcode.

Reason for Nominating to 5.6 :

This yield significant improvement in performance.

Risk:

Low risk; The risky change was #3985 which is already part of 5.6. This PR is a followup realization that because of #3985 we do not need to run that expensive bounds computation at all.

Reviewed By: @neonichu @abertelrud

Automated Testing: Unit test, package compatibility test suite

Dependencies: None

Impact on CI: None

How to Verify: Resolve [non-trivial] package dependencies and make sure the resolved versions (eg content of Package.resolved) are identical but that the performance is better

motivation: improve dependency resolution performance

changes:
* add informational diagnostics on manifest cache hit/miss
* disable expensive optimization in pubgrub resolver that has no functional value given changes from  swiftlang#3985
* adjust resolver workspace delgate to be less noisy given the difference in resolution callbacks
@tomerd tomerd added ready Author believes the PR is ready to be merged & any feedback has been addressed 5.6 labels Jan 13, 2022
@tomerd

This comment has been minimized.

@tomerd

This comment has been minimized.

@tomerd

This comment has been minimized.

motivation: clean output to user

changes: remove debug leftover from swiftlang#4007
@tomerd
Copy link
Contributor Author

tomerd commented Jan 13, 2022

@swift-ci please test

@tomerd tomerd requested a review from airspeedswift January 13, 2022 04:55
@tomerd tomerd self-assigned this Jan 13, 2022
@tomerd tomerd merged commit 5d59d29 into swiftlang:release/5.6 Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants