Skip to content

Move a couple statics that are highly contended on solution load to just be class members as their container is a singleton.#12679

Merged
ToddGrun merged 1 commit intodotnet:mainfrom
ToddGrun:dev/toddgrun/ReduceContentionInRazorAnalyzerAssemblyRedirectorNew
Jan 14, 2026
Merged

Move a couple statics that are highly contended on solution load to just be class members as their container is a singleton.#12679
ToddGrun merged 1 commit intodotnet:mainfrom
ToddGrun:dev/toddgrun/ReduceContentionInRazorAnalyzerAssemblyRedirectorNew

Conversation

@ToddGrun
Copy link
Contributor

Looks like there is some concurrent invocation of this method that happens during solution load that is hitting some contention around static variable usage. As this is within a singleton MEF component, we can just move those static variables to be instance variables and remove this point of contention.

*** Before ***
image

*** After ***
image

…ust be class members as their container is a singleton.
@ToddGrun ToddGrun requested a review from chsienki January 14, 2026 15:51
@ToddGrun ToddGrun requested a review from a team as a code owner January 14, 2026 15:51
@ToddGrun ToddGrun merged commit 5207bf4 into dotnet:main Jan 14, 2026
10 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jan 14, 2026
@davidwengier davidwengier modified the milestones: Next, 18.4 Jan 27, 2026
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.

2 participants