-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Change traverseModules
to return modules with their dependencies
#7977
Conversation
@swift-ci Please test |
/// provides the data to the caller by means of `onModule` callback. The products | ||
/// are completely transparent to this method and are represented by their module dependencies. | ||
/// Calls `onModule` for every module in the the package with the modules that depend on it. The products are | ||
/// completely transparent to this method and are represented by their module dependencies. | ||
package func traverseModules( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to filter out all of duplicate spots where a particular module is used then all you need to do is modify depthFirstSearch
to not walk into duplicate nodes, this method can stay the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it to check whether we visited a node already in successors
.
ab9e327
to
1407b2a
Compare
@swift-ci Please test |
1407b2a
to
497c9fe
Compare
Opening the SourceKit-LSP workspace using a debug build of sourcekit-lsp takes about 35s because `traverseModules` generates about 800,000 callback calls. All SourceKit-LSP needs now are the modules and their dependencies, so we can refactor `traverseModules` to visit only node once. With these changes getting all modules and their dependencies only takes ~0.013s. rdar://136107035
497c9fe
to
ff4d624
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
@swift-ci Please test |
Companion of swiftlang/sourcekit-lsp#1683
Opening the SourceKit-LSP workspace using a debug build of sourcekit-lsp takes about 35s because
traverseModules
generates about 800,000 callback calls. All SourceKit-LSP needs now are the modules and their dependencies, so we can refactortraverseModules
to just return that information avoid visiting the same modules multiple times. With theses changes getting all modules and their dependencies only takes ~0.013s.rdar://136107035