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] Review compiler options (again) #80217

Closed
3 of 4 tasks
lewing opened this issue Jan 5, 2023 · 5 comments
Closed
3 of 4 tasks

[wasm] Review compiler options (again) #80217

lewing opened this issue Jan 5, 2023 · 5 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Codegen-meta-mono
Milestone

Comments

@lewing
Copy link
Member

lewing commented Jan 5, 2023

We're currently generating and processing full dwarf debug information for native and aot'd methods, then in a separate pass stripping that information in release mode (depending on several options) this can add substantial time and memory overhead. We need to review the emscripten compiler options and optimize the default case better. As part of the process we should review some of the properties we use and see if there is an easy way to surface some of them to the customer.

see #79874 #80103

@dotnet-issue-labeler
Copy link

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.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 5, 2023
@lewing lewing added the arch-wasm WebAssembly architecture label Jan 5, 2023
@ghost
Copy link

ghost commented Jan 5, 2023

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

Issue Details

We're currently generating and processing full dwarf debug information for native and aot'd methods, then in a separate pass stripping that information in release mode (depending on several options) this can add substantial time and memory overhead. We need to review the emscripten compiler options and optimize the default case better. As part of the process we should review some of the properties we use and see if there is an easy way to surface some of them to the customer.

see #79874

Author: lewing
Assignees: radical
Labels:

arch-wasm, untriaged

Milestone: -

@lewing lewing added this to the 8.0.0 milestone Jan 5, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 5, 2023
@pavelsavara
Copy link
Member

  • explore -Oz vs -O2 in dotnet.wasm of the runtime pack.
  • figure out if -fPIC is a good thing for us
  • figure out what makes the data section break into thousands of sections vs just two in AOT. Maybe wasm-ld ?

@lewing
Copy link
Member Author

lewing commented Jan 17, 2023

to expand a bit:

  1. the tests are exceptional in that they by design use most of the api surface and as a result are hard to AOT so we use special options to the compiler to stay inside container limits
  2. our default settings generate and process dwarf info in the first linker pass and that info causes some really degenerate behavior in wasm-opt when it has to process all the relocations for all the symbols. we really only use the name and possibly line information in the dwarf symbols, and we strip that information on publish so we should probably change our options to stop doing the expensive in time and space relocation processing
    that patch fixes 1. for some of the tests (-01 skips wasm-opt in finalize)
    there might be other cases we should tweak
    fixing 2. would fix the default case
def should_run_binaryen_optimizer():
  # run the binaryen optimizer in -O2+. in -O0 we don't need it obviously, while
  # in -O1 we don't run it as the LLVM optimizer has been run, and it does the
  # great majority of the work; not running the binaryen optimizer in that case
  # keeps -O1 mostly-optimized while compiling quickly and without rewriting
  # DWARF etc.

see #80143 for initial attempt

@pavelsavara
Copy link
Member

@lewing lewing modified the milestones: 8.0.0, 9.0.0 Jul 18, 2023
@lewing lewing closed this as completed Jul 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Codegen-meta-mono
Projects
None yet
Development

No branches or pull requests

4 participants