dotnet / dotnet-wasi-sdk

An SDK for building .NET projects as standalone WASI-compliant modules
MIT License
276 stars 12 forks source link

Debug and Release build to the same (unoptimised?) Wasm #13

Open RReverser opened 1 year ago

RReverser commented 1 year ago

It appears that right now choosing the Release configuration via

dotnet build --configuration Release

doesn't change anything:

FullName                                                                     Length
--------                                                                     ------
C:\Users\me\Documents\MyFirstWasiApp\bin\Debug\net7.0\MyFirstWasiApp.wasm   8884056
C:\Users\me\Documents\MyFirstWasiApp\bin\Release\net7.0\MyFirstWasiApp.wasm 8884056

I was expecting the Release output to be smaller as it would be built with optimisations enabled.

RReverser commented 1 year ago

Hm I see there's separate WASI config under the dotnet/runtime repo that does support optimisation flags already: https://github.com/dotnet/runtime/blob/main/src/mono/wasi/wasi.proj

Should we use that over this SDK?