-
Notifications
You must be signed in to change notification settings - Fork 824
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
Lower libwasmer headless size #3123
Conversation
plotters 0.3.2 and pest 2.2.1 were yanked, issued `cargo update` to resolve.
3122: Update Cargo.lock dependencies r=epilys a=epilys plotters 0.3.2 was yanked, issued `cargo update` to resolve. Co-authored-by: Manos Pitsidianakis <[email protected]>
By using lto optimization flags. A qjs.wasm executable using the headless engine now weights 4.6MiB: % du -sh qjs-he*.out 20M qjs-headfull.out 4.6M qjs-headless.out
[lib] | ||
crate-type = ["cdylib", "rlib"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is needed for wasm-bindgen / wasmer-js (wasi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary for the lto though. Do you know what command/build fails for wasm-bindgen/wasmer-js if this is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add the crate-type as a special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime tests - JS have passed by the way.
This relies in the LLVM LTO flags and using llvm bitcode to let LLVM optimize things. I believe there might be better ways to do it as |
This is literally the same solution, except for using |
Afaik the solution in this PR relies on LLVM bitcode and using LTO while the one for |
Brought libwasmer-headless.a from 22MiB to 7.2MiB (on my machine)
By using lto optimization flags.
A qjs.wasm executable using the headless engine now weights 4.6MiB:
% du -sh qjs-he*.out
20M qjs-headfull.out
4.6M qjs-headless.out