Skip to content

Move calculation of TagHelperCollector.MightContainTagHelpers into the cache#12195

Merged
ToddGrun merged 2 commits intomainfrom
dev/toddgrun/MightContainTagHelpers_Perf
Sep 9, 2025
Merged

Move calculation of TagHelperCollector.MightContainTagHelpers into the cache#12195
ToddGrun merged 2 commits intomainfrom
dev/toddgrun/MightContainTagHelpers_Perf

Conversation

@ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Sep 8, 2025

MightContainTagHelpers shows heavily in CPU profiles in the RoslynCodeAnalysisService process in the RazorEditingTests.CompletionInCohosting speedometer test.

Before, cpu cost was around 8.5 seconds for MightContainTagHelpers and the TagHelperCollector.s_perAssemblyCache CWT. With the change in this PR, the combined CPU cost for the two is around 1.5 seconds.

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

*** Old CPU ***
image

*** New CPU ***
image

…e cache

MightContainTagHelpers shows up as 6.6% of CPU in the RoslynCodeAnalysisService process in the html completion scenario in the RazorEditingTests.CompletionInCohosting speedometer test.

Going to get a perf run to make sure the increased CWT usage doesn't end up negating the perf benefit.
@ToddGrun ToddGrun requested a review from a team as a code owner September 8, 2025 16:34
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.

Very nice!

@ToddGrun ToddGrun merged commit 521425e into main Sep 9, 2025
11 checks passed
@ToddGrun ToddGrun deleted the dev/toddgrun/MightContainTagHelpers_Perf branch September 9, 2025 15:31
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 9, 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.

4 participants