-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Unify managed runtime type name parsers #83484
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection Issue Detailsnull
|
272d056
to
ded1cc3
Compare
ded1cc3
to
3a1ca01
Compare
3a1ca01
to
f4f76e5
Compare
@@ -401,11 +396,4 @@ class TypeName | |||
Factory<InlineSString<128> > m_nestNameFactory; |
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.
I plan to delete the unmanaged type name parser and switch VM to use the managed one everywhere in a follow up change.
This is ready for review. |
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameParser.NativeAot.cs
Outdated
Show resolved
Hide resolved
ecf2d62
to
e939806
Compare
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
// | ||
// Parser for type names passed to GetType() apis. | ||
// | ||
internal sealed class TypeParser |
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.
The unified implementation evolved from this native aot-specific implementation.
src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameParser.CoreCLR.cs
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameParser.NativeAot.cs
Show resolved
Hide resolved
src/mono/System.Private.CoreLib/src/System/Reflection/TypeNameParser.Mono.cs
Show resolved
Hide resolved
36b039f
to
9f89797
Compare
Known issues |
@AaronRobinsonMSFT Thank you for reviewing this PR! |
Contributes to #72833 and #77868
The performance effect of this change on typical use of
Type.GetType
likeType.GetType("MyType, MyAssembly")
is in the noise range. The typical use ofType.GetType
spends most of the time in assembly loader and type loader. The time spent by parsing the type name is small fraction of the total and the performance improvement is hardly noticeable.When the type name parser performance is measured in isolation, it is several times faster compared to the existing unmanaged CoreCLR type name parser. For example:
is about 3x faster with this change on CoreCLR.