Skip to content
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

Blazor WASM produces larger binaries with dotnet 9 compared to dotnet 8, even with WasmStripILAfterAOT=true #110143

Open
iSeiryu opened this issue Nov 25, 2024 · 1 comment
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono untriaged New issue has not been triaged by the area owner

Comments

@iSeiryu
Copy link

iSeiryu commented Nov 25, 2024

Related discussion: #92238 (comment)

Since that issue was closed I'm opening a new one.

> dotnet --info
.NET SDK:
 Version:           9.0.100
 Commit:            a2bc464e40
 Workload version:  9.0.100-manifests.6bf02610
 MSBuild version:   17.12.7+a2bc464e4

My .csproj

<PropertyGroup>
  <TargetFramework>net9.0</TargetFramework>
  <Nullable>enable</Nullable>
  <ImplicitUsings>enable</ImplicitUsings>
  <InvariantGlobalization>true</InvariantGlobalization>
  <BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
  <BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData>
  <WasmExceptionHandling>true</WasmExceptionHandling>
  <WasmSIMD>false</WasmSIMD>
</PropertyGroup>

Publish command

dotnet publish UI.csproj -c Release -p:RunAOTCompilation=true -p:WasmStripILAfterAOT=true

The size of dotnet.native.wasm.gz on:

  • dotnet 8 with WasmStripILAfterAOT=false - 3.7MB
  • dotnet 8 with WasmStripILAfterAOT=true - 2.5MB (but the app fails to launch)
  • dotnet 9 with WasmStripILAfterAOT=true - 4MB

You can find a published app here:
https://iseiryu.github.io/blazor-aot
https://github.com/iSeiryu/iseiryu.github.io/tree/main/blazor-aot
Source code:
https://github.com/iSeiryu/blazor-wasm-experiments

@javiercn javiercn transferred this issue from dotnet/aspnetcore Nov 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 25, 2024
@iSeiryu iSeiryu changed the title Blazor WASM produces larger biniries with dotnet 9 compared to dotnet 8 Blazor WASM produces larger biniries with dotnet 9 compared to dotnet 8, even with WasmStripILAfterAOT=true Nov 25, 2024
@lewing lewing added the arch-wasm WebAssembly architecture label Nov 25, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@iSeiryu iSeiryu changed the title Blazor WASM produces larger biniries with dotnet 9 compared to dotnet 8, even with WasmStripILAfterAOT=true Blazor WASM produces larger binaries with dotnet 9 compared to dotnet 8, even with WasmStripILAfterAOT=true Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants