Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce allocations in AbstractRecommendationServiceBasedCompletionPro…
…vider.GetSymbolsAsync (#72157) This method was individually adding items to an ArrayBuilder without it's size configured. Potential issues with the current approach: 1) There could be multiple resizes during the Add calls to get the array to it's final size 2) Very likely the final capacity will exceed the array size, causing an allocation in generating the immutablearray. 3) I was seeing a large number of items in these arrays, causing the array that does get created not to get freed back into the pool. Instead, if we use the SelectAsArray method, we shouldn't have any extra allocations other than the resultant ImmutableArray.
- Loading branch information