-
Notifications
You must be signed in to change notification settings - Fork 418
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
Optimize Intellisense performance #1761
Changes from all commits
98b4811
52ea00f
4c38ec0
325deb5
3800c96
7c9437e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ public async Task<IEnumerable<AutoCompleteResponse>> Handle(AutoCompleteRequest | |
|
||
// get recommended symbols to match them up later with SymbolCompletionProvider | ||
var semanticModel = await document.GetSemanticModelAsync(); | ||
var recommendedSymbols = await Recommender.GetRecommendedSymbolsAtPositionAsync(semanticModel, position, _workspace); | ||
var recommendedSymbols = (await Recommender.GetRecommendedSymbolsAtPositionAsync(semanticModel, position, _workspace)).ToArray(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Collecting recommendedSymbols into an array, instead of passing Rolsyn's opaque collection type, pulled a lot of weight here. Note that this gets that expensive .Where() call inside the BigN loop (number of elements in the auto complete dropdown). Actually tried to test with this change only, and it does help a lot, but only does half of the job. |
||
|
||
var isSuggestionMode = completionList.SuggestionModeItem != null; | ||
foreach (var item in completionList.Items) | ||
|
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.
Calls to the ImmutableDictionary.GetValue<> were the main CPU-hog, now they are cached outside of the loop.