-
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
Switch FAR data from an immutable dictionary to an immutable array #73587
Conversation
src/EditorFeatures/Core/LanguageServer/EditorLspReferencesResultCreationService.cs
Show resolved
Hide resolved
{ | ||
additionalProperties.Add(containingMemberProperty); | ||
if (node != null) |
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.
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.
preserving existing code. and yes, it looks like it calls a helper that can return null.
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs
Outdated
Show resolved
Hide resolved
//private static bool TryGetAdditionalProperty(string propertyName, ISymbol symbol, out KeyValuePair<string, string> additionalProperty) | ||
//{ | ||
// if (symbol == null) | ||
// { | ||
// additionalProperty = default; | ||
// return false; | ||
// } |
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.
//private static bool TryGetAdditionalProperty(string propertyName, ISymbol symbol, out KeyValuePair<string, string> additionalProperty) | |
//{ | |
// if (symbol == null) | |
// { | |
// additionalProperty = default; | |
// return false; | |
// } |
@@ -68,7 +69,7 @@ public async Task NavigateToAsync(NavigationOptions options, CancellationToken c | |||
StandardTableKeyNames.Column => mappedSpanResult.LinePositionSpan.Start.Character, | |||
StandardTableKeyNames.ProjectName => GetProjectName(), | |||
StandardTableKeyNames.ProjectGuid => _boxedProjectGuid, | |||
StandardTableKeyNames.Text => lineText.ToString().Trim(), | |||
StandardTableKeyNames.Text => _trimmedLineText ??= lineText.ToString().Trim(), |
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.
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.
First commit moves us from an expensive immutable dictionary to a simple immutable array. As this array only ever holds a max of two items, the dictionary was gross overkill.
Second commit avoids lock overhead in a common case where the FAR window repeatedly asks the same entities for data after we tell it to refresh.
This drops us from about 35Msecs computation time on the client to around 31Msecs