Skip to content

Speed up analyzer-based tests by 6x#81673

Merged
CyrusNajmabadi merged 3 commits intodotnet:mainfrom
CyrusNajmabadi:testPerf
Dec 12, 2025
Merged

Speed up analyzer-based tests by 6x#81673
CyrusNajmabadi merged 3 commits intodotnet:mainfrom
CyrusNajmabadi:testPerf

Conversation

@CyrusNajmabadi
Copy link
Contributor

before:

image

after:

image


protected override AnalyzerFileReference GetOrCreateAnalyzerFileReference(string filePath)
{
if (!s_cachedAnalyzerFileReferences.TryGetValue(filePath, out var analyzerFileReference))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

avoids the costly shadow copying that would otehrwise occur per test.

@CyrusNajmabadi CyrusNajmabadi merged commit 6d430e5 into dotnet:main Dec 12, 2025
25 of 26 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the testPerf branch December 12, 2025 18:20
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 12, 2025
@davidwengier davidwengier modified the milestones: Next, 18.3 Jan 6, 2026
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