-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Improve performance on SymbolCompletionProviderTests #70307
Closed
Rekkonnect
wants to merge
4
commits into
dotnet:main
from
Rekkonnect:test-perf/symbol-completion/baseline
Closed
Improve performance on SymbolCompletionProviderTests #70307
Rekkonnect
wants to merge
4
commits into
dotnet:main
from
Rekkonnect:test-perf/symbol-completion/baseline
Conversation
This file contains 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
dotnet-issue-labeler
bot
added
Area-IDE
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Oct 9, 2023
ghost
added
the
Community
The pull request was submitted by a contributor who is not a Microsoft employee.
label
Oct 9, 2023
Comment on lines
259
to
263
var result = ImmutableArray.Create( | ||
CompletionTestExpectedResult.Absent("String"), | ||
CompletionTestExpectedResult.Absent("System") | ||
); | ||
await VerifyExpectedItemsAsync(code, result); |
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.
Suggested change
var result = ImmutableArray.Create( | |
CompletionTestExpectedResult.Absent("String"), | |
CompletionTestExpectedResult.Absent("System") | |
); | |
await VerifyExpectedItemsAsync(code, result); | |
await VerifyExpectedItemsAsync(code, [ | |
CompletionTestExpectedResult.Absent("String"), | |
CompletionTestExpectedResult.Absent("System") | |
]); |
And so on and so forth.
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.
I must definitely get used to collection expressions. You may cancel the current check runs.
3 tasks
Closing in favor of #75496 |
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.
With approval from @CyrusNajmabadi, many tests in
SymbolCompletionProviderTests
were adjusted with new methods that allow checking for multiple items in the suggestions with a single run, hence improving performance.This PR contains those adjustments for many tests that were the biggest hits, with either many verifications in the same method on the same source, or in test theories that have many distinct combinations.
Additionally, the new API makes it cheaper to test the available and displayed items more extensively.
Benchmarks
Running all the tests in SymbolCompletionProviderTests (about 830), takes:
The performance aligns with the theory of each individual
await Verify...
doing unnecessary work to parse, etc. up until the completion is triggered, in order to a.Notes
The new version removes seemingly unnecessary arguments and bathces each individual argument about a specific item in a record. These may be freely updated depending on the requirements for each test.
Test methods that only verify exactly one item are not meant to be updated.