-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Size regression in Blazor WASM apps #40521
Comments
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsLooking at https://aka.ms/dotnetperfstatus, there is a 140KB size regression in the default Blazor WASM app size between the following commits: dotnet/runtime@6b83269...06228c1 SOD - New Blazor Template - PublishSOD - New Blazor Template - Publish - AOTWe should investigate what change caused this size regression and if there is anything that can be done. From looking at the charts, it mostly comes from System.Private.CoreLib: BeforeAfter
|
Moving to aspnetcore, since that is what caused this regression. There isn't anything dotnet/runtime can do here. |
It's really great that we're able to detect this kind of thing systematically. Thanks for letting us know, @eerhardt! |
Thanks for contacting us. We're moving this issue to the |
@eerhardt do you think there's a way to update |
I think that could help here. System.Text.Json is already using Reflection.Emit directly. And the Linq.Expressions code Compiling a Lambda function is already using it as well. So re-writing this code to use Ref.Emit directly would cut Linq.Expressions out of the equation. |
We could approach it this way - I'll roll back the change citing this regression. We're on strike two because this is also a source-breaking change. I'll file a runtime issue to consider changing ActivatorUtils to use ILEmit (when possible). If that lands in 7.0 and we can verify there isn't a size regression, we'll add the change back in. @SteveSandersonMS how does that sound? |
Another thing to consider is dotnet/runtime#38439, and NativeAOT in general. Using Linq.Expressions allows the underlying implementation to be switched out (interpreter vs ILEmit). Where if you jump directly to ILEmit, you would need to do the switching yourself. So we may need to check |
Yep, great - thanks. Rolling this change back does feel right. Maybe activation-by-default could come back in the future if the underlying implementation is updated, but it's not a big loss to tell customers they can do this themselves in user code. |
Closing this as we've reverted the change which contributed to this. |
Looking at https://aka.ms/dotnetperfstatus, there is a 140KB size regression in the default Blazor WASM app size between the following commits:
dotnet/runtime@6b83269...06228c1
SOD - New Blazor Template - Publish
SOD - New Blazor Template - Publish - AOT
We should investigate what change caused this size regression and if there is anything that can be done.
From looking at the charts, some of it comes from System.Private.CoreLib:
Before
After
But the biggest file that added here is
System.Linq.Expressions.dll
. It isn't in theBefore
, but in theAfter
it is over 100KB itself:After
Maybe a new ASP.NET change now brings in Linq.Expressions by default? cc @SteveSandersonMS @captainsafia
cc @lewing @SamMonoRT
The text was updated successfully, but these errors were encountered: