Repository navigation
Avoid namespace formatting in ILLink analyzer type checks - #134732
Merged
tannergooding merged 2 commits intoOct 8, 2026
Merged
tannergooding merged 2 commits into
tannergooding merged 2 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
This was notably a significant measurable bottleneck for TerraFX.Interop.Windows and I root caused it via a build profile down to these APIs. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
sbomer
reviewed
Oct 7, 2026
Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ILLink's Roslyn analyzer checks many type symbols against a small set of well-known types. The previous lookup formatted a symbol's containing namespace before ruling out mismatched type names, creating avoidable work and allocations in large generated compilations.
Check the metadata name first so mismatches skip namespace formatting. Handle Roslyn special types directly and compare the requested namespace/name for other types, preserving the existing result for invalid well-known-type values. Add positive and negative analyzer tests that verify diagnostics and locations for well-known, derived, and unrelated types.
Performance
On Windows x64 with SDK
11.0.100-rc.1.26420.103, a synthetic interop-shaped compilation of 20,001 files and 160,000 methods was rebuilt in Release with ILLink, NET analyzers, and XML documentation enabled. Eight warmed, interleaved full-rebuild pairs compared the original analyzer with the final implementation:Median paired saving: 7.20 s. The three ILLink warning lines matched exactly in every pair. These are elapsed build times, not concurrent aggregate analyzer seconds. The synthetic .NET 11 workload is representative of a large partial-heavy compilation; it does not measure the motivating TerraFX net10 Debug build.
Validation
51 focused ILLink analyzer tests passed, including data-flow and generated-code coverage.
Note
This PR description was drafted with GitHub Copilot.