Skip to content

Perf: Cache IsViewComponent results#12201

Merged
ToddGrun merged 3 commits intodotnet:mainfrom
ToddGrun:dev/toddgrun/IsViewComponent_Performance
Sep 10, 2025
Merged

Perf: Cache IsViewComponent results#12201
ToddGrun merged 3 commits intodotnet:mainfrom
ToddGrun:dev/toddgrun/IsViewComponent_Performance

Conversation

@ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Sep 9, 2025

Cache calculation of whether an INamedTypeSymbol represents a view component. Over the 5 speedometer runs I looked at, the existing calculation averaged 2200 ms of total CPU in the Razor cohosting completion speedometer test. A speedometer run with a CWT cache around this calculation, cut the average cost down to 900 ms.

Test insertion: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/668281

*** example old CPU ***
image

*** example new CPU ***
image

-- will add details if perf run indicates benefits
@ToddGrun ToddGrun requested a review from a team as a code owner September 9, 2025 01:14
@ToddGrun ToddGrun changed the title *** WIP: Cache IsViewComponent results Perf: Cache IsViewComponent results Sep 9, 2025
Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

…it through an extension method on INamedTypeSymbol.
@ToddGrun
Copy link
Contributor Author

@DustinCampbell -- Can you take another peek tomorrow and verify this mostly matches your thoughts?

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good as it is, but I added some feedback to consider.

@ToddGrun ToddGrun merged commit 33137bc into dotnet:main Sep 10, 2025
11 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 10, 2025
@akhera99 akhera99 modified the milestones: Next, 18.0 P1, 18.0 P2 Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants