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

[wasm] Selectively strip the Name section of the wasm blob #43690

Closed
CoffeeFlux opened this issue Oct 21, 2020 · 7 comments
Closed

[wasm] Selectively strip the Name section of the wasm blob #43690

CoffeeFlux opened this issue Oct 21, 2020 · 7 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono
Milestone

Comments

@CoffeeFlux
Copy link
Contributor

Currently, this section takes up about 150K without ICU and 550K with ICU. For a minimal sample we should get rid of everything other than a handful of functions. For the normal build we should get rid of the ICU symbols other than the ones we call directly since they are of little benefit to us in stack traces. See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Oct 21, 2020
@CoffeeFlux CoffeeFlux added arch-wasm WebAssembly architecture area-Build-mono and removed untriaged New issue has not been triaged by the area owner labels Oct 21, 2020
@CoffeeFlux CoffeeFlux added this to the 6.0.0 milestone Oct 21, 2020
@lewing
Copy link
Member

lewing commented Nov 10, 2020

@CoffeeFlux it is much more useful to speak in terms of compressed size for metrics like this.

@lewing
Copy link
Member

lewing commented Nov 10, 2020

Stripping all the debug information via wasm-opt --strip-debug which removes more than the name section produces:

dotnet.wasm Case
2818531 full uncompressed
2281278 stripped uncompressed
537253 difference uncompressed
883475 brotli with debug
776250 brotli stripped
107225 brotli difference

Which is worth noting in the sense that the names/debug information clearly compressed more than the bulk of dotnet.wasm

@lewing lewing removed their assignment Nov 10, 2020
@lewing
Copy link
Member

lewing commented Nov 10, 2020

@kg thoughts on how difficult it would be to strip all names matching a regex while preserving the rest?

@kg
Copy link
Member

kg commented Nov 10, 2020

@kg thoughts on how difficult it would be to strip all names matching a regex while preserving the rest?

Very easy, we'd eat an extra byte or two of filler for the stripped names worst case but it'll compress out

@lewing
Copy link
Member

lewing commented Nov 11, 2020

@tqiu8 please prioritize

@tqiu8
Copy link
Contributor

tqiu8 commented Nov 12, 2020

This is no longer an issue due to #43951, which uses wasm-opt from emscripten to strip out the custom section including names. This will not affect the debugger performance.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
Development

No branches or pull requests

5 participants