Skip to content

Reduce allocations in InlayHintHandler.GetInlayHintsAsync#80284

Merged
ToddGrun merged 1 commit intodotnet:mainfrom
ToddGrun:dev/toddgrun/InlayHintsHandlerAllocations
Sep 16, 2025
Merged

Reduce allocations in InlayHintHandler.GetInlayHintsAsync#80284
ToddGrun merged 1 commit intodotnet:mainfrom
ToddGrun:dev/toddgrun/InlayHintsHandlerAllocations

Conversation

@ToddGrun
Copy link
Contributor

  1. Move syntaxVersion.ToString call outside the loop
  2. Avoid ArrayBuilder.ToImmutable and JoinText calls in the common single item scenario

This should significantly reduce the highlighted allocations below (1.8%) in the razor cohosting speedometer test

image

1) Move syntaxVersion.ToString call outside the loop
2) Avoid ArrayBuidler usage, ArrayBuilder.ToImmutable call and JoinText call in the common single item scenario
@ToddGrun ToddGrun requested a review from a team as a code owner September 15, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants