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
--separate-asm + -s BINARYEN=1 still downloads .asm.js code #4909
Comments
Related, building with However if one does pass |
Well, if the asm.js might be used - like when the method is Maybe we could just add a warning if |
… code when --separate-asm and -s BINARYEN=1 are passed.
I think we should never unconditionally download both, but first figure out which one would be needed, and only download that one? The above PR does seem to work well at in at least avoiding the .asm.js download at startup, does that make sense to you? Although I wonder if I'm seeing this right and it's now doing a sync XHR to obtain it when wasm support is disabled, hmm. |
Well, that's assuming we can never be surprised later. E.g. you might see the browser has wasm support, but when you try to instantiate the wasm, it might fail for some reason. I guess the question is whether we want to support that. Currently, binaryen tries each method and checks for failure, it doesn't assume it can know ahead of time which will work (if it could know that, it wouldn't need to check one by one). How important is it to optimize the case of fallback/multiple methods? Any build with both asm and wasm enabled will be a poorly-optimized one anyhow. |
Ideally we would in such a scenario first download .wasm, try it, if it doesn't work, only then download .asm.js. Supporting fallback is important, at least for a while, but at present the |
… code when --separate-asm and -s BINARYEN=1 are passed.
… code when --separate-asm and -s BINARYEN=1 are passed.
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Running
em++ tests\hello_world.cpp --separate-asm -s BINARYEN=1 -o a.html
, gives the following in the generateda.html
file:which downloads
.asm.js
even when generating .asm.js was not requested. The extra code here isThe solution is to drop the
--separate-asm
flag here, which removes the extra code.This hints that perhaps we should make
--separate-asm
flag be ignored when targeting only Wasm, since it generates this redundant code?The text was updated successfully, but these errors were encountered: