Skip to content

[5.9][AST] Do not copy SearchPathOptions in updateNonUserModule #64791

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 1 commit into from
Mar 31, 2023

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Mar 30, 2023

  • Explanation: Fixes a major performance regression caused by an accidental copy of SearchPathOptions when a file is added to a module.
  • Scope: All module loading
  • Risk: Low; replaces the previously-always-called check with a cached request instead
  • Testing: Checked performance regression was fixed
  • Original PR: [AST] Do not copy SearchPathOptions in updateNonUserModule #64593

@bnbarham bnbarham requested a review from a team as a code owner March 30, 2023 22:44
@bnbarham
Copy link
Contributor Author

@swift-ci please test

`updateNonUserModule` was accidentally copying `SearchPathOptions`. Take
a reference to it instead. Also, since `addFile` is actually called many
times (once for every submodule, of which there are many), change
`isNonUserModule` to a request so that it's only calculated when needed.

Resolves rdar://107155587.

(cherry picked from commit 8e6c996)
@bnbarham bnbarham force-pushed the cherry-search-copy branch from 82fc0d6 to 33db8a5 Compare March 31, 2023 17:18
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham merged commit 0f455d1 into swiftlang:release/5.9 Mar 31, 2023
@bnbarham bnbarham deleted the cherry-search-copy branch March 31, 2023 22:35
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
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 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants