Repository navigation
Analyzers: Build MUD0002 component descriptors only on cache misses - #13844
Merged
Merged
Conversation
danielchalmers
added this pull request to stack #13848
September 14, 2026 15:05
This was referenced Sep 27, 2026
This was referenced Oct 2, 2026
Merged
chore(deps): Bump the nuget-dependencies group with 3 updates
JerrettDavis/StableDiffusionStudio#107
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First of four stacked PRs that speed up the MUD0002 analyzer added in #13831 and #13841.
_componentDescriptors.GetOrAdd(type, ComponentDescriptor.GetComponentDescriptor(...))built the descriptor before the lookup, so everyOpenComponentwalked the component's members and scanned the migration catalog, even when the descriptor was already cached.This passes a cached
FunctoGetOrAddinstead, so a cache hit does no work and allocates nothing.netstandard2.0 has no
GetOrAdd<TArg>overload, hence the stored delegate.Concurrent misses can still build a descriptor twice;
GetOrAddkeeps the first, as before.Descriptors built while analyzing MudBlazor.Docs drop from 8,176 (one per lookup) to 1,755.
Most of the remaining 1,755 come from inferred generic components, which the third PR in this stack addresses.
How this was measured
CompilationWithAnalyzers, so no cached results are reused.GC.GetTotalAllocatedBytes(precise: true)across all threads, minus a no-op analyzer that registers the same actions.