-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use emit-based invoke for all of WASM including DI #85065
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
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsMakes the newer emit-based reflection added to Mono in .NET 8.0 also support Blazor\WASM. (perf numbers to come in a bit). Also addresses main requirement for #66153 which is to allow ASP.NET to use DI's
|
|
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsMakes the newer emit-based reflection added to Mono in .NET 8.0 also support Blazor\WASM. (perf numbers to come in a bit). Also addresses main requirement for #66153 which is to allow ASP.NET to use DI's
|
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsMakes the newer emit-based reflection added to Mono in .NET 8.0 also support Blazor\WASM. (perf numbers to come in a bit). Also addresses main requirement for #66153 which is to allow ASP.NET to use DI's
|
|
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsMakes the newer emit-based reflection added to Mono in .NET 8.0 also support Blazor\WASM. (perf numbers to come in a bit). Also addresses main requirement for #66153 which is to allow ASP.NET to use DI's
|
src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/InvokerEmitUtil.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ActivatorUtilities.cs
Show resolved
Hide resolved
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.
LGTM, the comment here was helpful for understanding better
Makes the newer emit-based reflection added to Mono in .NET 8.0 also support Blazor\WASM.
Also addresses main requirement for #66153 which is to allow ASP.NET to use DI's
ActivatorUtilities.CreateFactorywithout a ~259K size regression (measuring size of .br files).The perf results for using an emit-based invoke instead of interpreted are not as good as the 2x-3x we saw for Core and Mono, but the expected overall improvement should be ~20-30% with the largest gain by far being a zero-arg constructor which is ~2.2x faster. Once the new fast invoke APIs are ready (which are based on emit), those are expected to further improve most cases; these will be used by DI once available.
Measurements below are in ms and for 1,000,000 iterations. Also includes the
object[] parametersalloc forMethodBase.Invoke()for cases that have parameters.