roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Reduce symbol array allocations during CSharpSemanticModel.LookupSymbolsInternal

Open ToddGrun opened this issue 1 year ago • 2 comments

During completion, I see this method generating results with several thousand entries which is evident in allocations in a profile I'm inspecting. This PR attempts to reduce intermediary arrays constructed during that process by modifying FilterNotReferenceable and FilterOverriddenOrHiddenIndexers to not require realization of an ImmutableArray as input.

Original allocations: image

After PR allocations: image

ToddGrun avatar Feb 16 '24 22:02 ToddGrun

Done with review pass (commit 3)

AlekseyTs avatar Feb 19 '24 18:02 AlekseyTs

Done with review pass (commit 6)

AlekseyTs avatar Feb 20 '24 16:02 AlekseyTs

@333fred for 2nd review

ToddGrun avatar Feb 27 '24 17:02 ToddGrun

@dotnet/roslyn-compiler for a 2nd review

ToddGrun avatar Feb 27 '24 20:02 ToddGrun

Nudge to @dotnet/roslyn-compiler again for 2nd review

ToddGrun avatar Feb 29 '24 19:02 ToddGrun