perf: index reflection metadata and cache security lookups in TypeGenerator - #53
Merged
Conversation
…erator Description lookups scanned the entire metadata XML document with an unindexed XPath query per class/member; security lookups re-deserialized the same JSON on every CanRead/CanWrite call. Both are now indexed/cached once. Output is unchanged.
Qodana for .NET257 new problems were found
☁️ View the detailed Qodana report Detected 1 dependencyThird-party software listThis page lists the third-party software dependencies used in Loom
Contact Qodana teamContact us at qodana-support@jetbrains.com
|
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.
Summary
ReflectionMetadataReadernow indexes the metadata XML once (class name -> element, then member name -> element per class) instead of running a full-document XPath//scan on every class/member description lookup.ClassUtility.GetSecurityresults are now memoized per member instance instead of re-deserializing the same JSON on everyCanRead/CanWritecall.ClassGenerator.GenerateParameter's Instance-type candidate list is built once instead of re-running theConcat+WhereLINQ chain against all ~400 class names per parameter.HasMatchingSuperclass/HasTagavoid an extra LINQ allocation per call.Test plan
dotnet build— succeeds, no warningsdotnet test— 1778/1778 pass🤖 Generated with Claude Code