-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix(wasm): don't wasm-opt twice #5253
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
base: master
Are you sure you want to change the base?
Conversation
|
A quick test didn't show meaningful performance difference for the generated parser between |
|
(Some parsers -- not gonna name and shame -- take an extraordinary amount of time and memory to compile to wasm, so trying to reduce that is worth it.) |
|
The point of the |
|
Yes. The result with |
|
Ok, here's a small test of 0.26.3 (with binaryen installed) vs. master vs. this PR vs.
So... not very conclusive. For complex parsers, In any case, the real issue here is memory pressure: the vim parser requires ~9 Gb sustained, spiking to >20 Gb, which completely throttles the github runner for the release workflow (which takes 40 minutes o.O). Note that this is specific to WASM; normal |
Would it make sense/be helpful to accept the optimization level as a flag? The double |
|
Since (in a perfect world) the wasm artifacts are built with a standard release workflow, I don't think that would be worth it. I think the best compromise for now is to keep |
Now that we run `wasm-opt` explicitly after compilation, skip it during the `clang` compile and link phase.
|
Thanks for collecting this data @clason . I agree that we want it to be standardized (and building wasm artifacts as release artifacts is gonna be fantastic). |
|
I think this upstream issue matches what we're seeing in tree-sitter-vim: llvm/llvm-project#47793 |
Now that we run
wasm-optexplicitly after compilation, skip it duringthe
clangcompile and link phase.Also disable
-Osoptimizations (saves time, and final wasm blob sizeis even slightly smaller this way).