Perf: Index only reachable products of package dependencies (#2427)#2444
Open
DPrakashhh wants to merge 1 commit intoswiftlang:mainfrom
Open
Perf: Index only reachable products of package dependencies (#2427)#2444DPrakashhh wants to merge 1 commit intoswiftlang:mainfrom
DPrakashhh wants to merge 1 commit intoswiftlang:mainfrom
Conversation
Member
|
As mentioned in #2427, I’d like to hear @rintaro and @hamishknight’s opinion on this idea before deciding whether this is the right direction to go in. |
Contributor
Author
|
yeah, sure i have done this so they can review this implementation quality and based on this they can decide whether to continue this or leave it :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2427
Summary
This PR optimizes background indexing by filtering out unreachable dependency products.
1-Logic: Uses
ModulesGraph.reachableProductsto identify only the dependency modules required by the root package.2-Safety: Always indexes all modules in the root package, regardless of reachability.
3-Implementation: Replaces the generic
traverseModulesinSwiftPMBuildServer.swiftwith a filteredtraverseReachableModuleswrapper.4-Clean Code: Moves filtering logic to a new
PackageGraph+Reachability.swift.