dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.75k forks source link

[wasm] Shrink data section in dotnet.wasm #49224

Closed CoffeeFlux closed 2 years ago

CoffeeFlux commented 3 years ago

This is surprisingly large in the uncompressed binary, especially with ICU linked in. It seems likely that getting rid of unnecessary strings, shrinking unused arrays, and deduplication efforts could potentially give us some wins post-compression, but we should try compressing a binary with the data section manually removed to see how much space it's taking up post-compression.

Invariant uncompressed:

13.1%   165Ki   NAN%       0    Data

ICU uncompressed:

23.0%   513Ki   NAN%       0    Data
ghost commented 3 years ago

Tagging subscribers to this area: @CoffeeFlux See info in area-owners.md if you want to be subscribed.

Issue Details
This is surprisingly large in the uncompressed binary, especially with ICU linked in. It seems likely that getting rid of unnecessary strings, shrinking unused arrays, and deduplication efforts could potentially give us some wins post-compression, but we should try compressing a binary with the data section manually removed to see how much space it's taking up post-compression. Invariant uncompressed: ``` 13.1% 165Ki NAN% 0 Data ``` ICU uncompressed: ``` 23.0% 513Ki NAN% 0 Data ```
Author: CoffeeFlux
Assignees: -
Labels: `arch-wasm`, `area-VM-meta-mono`, `size-reduction`
Milestone: 6.0.0
CoffeeFlux commented 3 years ago

Related: https://github.com/rustwasm/twiggy https://github.com/rustwasm/wasm-snip https://reviews.llvm.org/D46417 https://reviews.llvm.org/D42511

ilonatommy commented 2 years ago

Closing in favor of more general: https://github.com/dotnet/runtime/issues/60249 that aims in shrinking the whole dotnet.wasm size.