Skip to content

[6.0 🍒] Cache visible Clang modules for interface printing in 'ModuleDecl' #74336

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

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 12, 2024

Cherry-pick of #74307

Explanation: Instead of caching the collection of visible Clang modules in the 'TypePrinter', compute and cache them in the 'ModuleDecl'. When printing a textual interface, the compiler will instantiate many new instances of 'TypePrinter', which means caching them there is not useful.

Risk: Low. This change alters the textual interface printing logic to cache computed visible modules per-ModuleDecl instead of per-TypePrinter. The logic to compute visible modules is unchanged.

Testing: This change does not affect any specific aspect of module emission, all existing tests in the test suite where a textual interface is emitted will exercise the new code-path.

Reviewed By: @tshortli

Instead of caching the collection of visible Clang modules in the 'TypePrinter', compute and cache them in the 'ModuleDecl'. When printing a textual interface, the compiler will instantiate many new instances of 'TypePrinter', which means caching them there is not useful.
@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 12, 2024
@artemcm artemcm requested a review from nkcsgexi June 12, 2024 14:37
@artemcm artemcm requested a review from a team as a code owner June 12, 2024 14:37
@artemcm
Copy link
Contributor Author

artemcm commented Jun 12, 2024

@swift-ci test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the build time improvement!

@artemcm artemcm enabled auto-merge June 12, 2024 16:40
@artemcm artemcm merged commit 0220b02 into swiftlang:release/6.0 Jun 12, 2024
5 checks passed
@artemcm artemcm deleted the 60CacheVisibleClangModulesInModules branch June 12, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants