-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Cache the AssemblyQualifiedName
property value
#118495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache the AssemblyQualifiedName
property value
#118495
Conversation
This follows the pattern for other names that are cached on RuntimeType.
Tagging subscribers to this area: @dotnet/area-system-reflection |
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
runtime/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs Lines 3836 to 3840 in a53ffc1
Cache property in number of places.
Dtto for all other names. |
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Jan Kotas <[email protected]>
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
Outdated
Show resolved
Hide resolved
Would you like to fix this one as well in this PR, or is it left for a separate PR? (It should be just about switching order of two lines and adding a test case.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Update Namespace property for function pointers.
@ericstj FYI this added some new tests for the Reflection stack and reworked some caching logic in RuntimeType. |
src/libraries/System.Runtime/tests/System.Reflection.Tests/TypeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime/tests/System.Reflection.Tests/TypeTests.cs
Outdated
Show resolved
Hide resolved
Remove redundant logic in FullName property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR caches the AssemblyQualifiedName
property value on RuntimeType
to improve performance by avoiding repeated computation. This follows the established pattern where other name properties like Name
, FullName
, and ToString
are already cached.
Key changes include:
- Adding caching for
AssemblyQualifiedName
property in both CoreCLR and Mono implementations - Consolidating name formatting logic and improving null handling for function pointers
- Removing unused
FormatNoVersion
flag from type string formatting
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs |
Adds caching for AssemblyQualifiedName , refactors name construction methods, and improves namespace handling |
src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs |
Updates method signatures to return nullable strings and improves function pointer handling |
src/libraries/System.Private.CoreLib/src/System/RuntimeType.cs |
Adds shared helper method IsFullNameRoundtripCompatible for consistent name validation |
src/coreclr/vm/typestring.h |
Removes unused FormatNoVersion flag from type string formatting |
src/coreclr/vm/typestring.cpp |
Simplifies assembly display name formatting by removing conditional version handling |
src/libraries/System.Runtime/tests/System.Reflection.Tests/TypeInfoTests.cs |
Adds tests for function pointer FullName and Namespace behavior |
This follows the pattern for other names that
are cached on
RuntimeType
.Fixes #118389