Skip to content

Perf: Index only reachable products of package dependencies (#2427)#2444

Open
DPrakashhh wants to merge 1 commit intoswiftlang:mainfrom
DPrakashhh:feature/filter-unreachable-products-2427
Open

Perf: Index only reachable products of package dependencies (#2427)#2444
DPrakashhh wants to merge 1 commit intoswiftlang:mainfrom
DPrakashhh:feature/filter-unreachable-products-2427

Conversation

@DPrakashhh
Copy link
Copy Markdown
Contributor

Fixes #2427
Summary
This PR optimizes background indexing by filtering out unreachable dependency products.

1-Logic: Uses ModulesGraph.reachableProducts to 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 traverseModules in SwiftPMBuildServer.swift with a filtered traverseReachableModules wrapper.
4-Clean Code: Moves filtering logic to a new PackageGraph+Reachability.swift .

@ahoppen
Copy link
Copy Markdown
Member

ahoppen commented Jan 9, 2026

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.

@DPrakashhh
Copy link
Copy Markdown
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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide if we want to index products of package dependencies

2 participants