- Notifications
You must be signed in to change notification settings - Fork622
perf: reduce wasm release binary size#4547
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Pull Request Overview
This PR aims to reduce the size of the wasm release binary by tweaking Cargo build profile options.
- Removed extra build options (codegen-units, debug, lto, strip) from the [profile.release-wasi] section.
- Retained essential settings via inheritance from the "release" profile and set opt-level to "s".
Comments suppressed due to low confidence (1)
Cargo.toml:16
- [nitpick] The [profile.release-wasi] block includes an 'inherits = "release"' line that appears redundant given the existing inheritance in the file. Consider removing one of the duplicate lines to simplify the configuration.
inherits = "release"
bf53a10
Uh oh!
There was an error while loading.Please reload this page.
NAPI-RS will remove debug information and symbols, but before doing so, it will first generate a rolldown-debug.wasm32-wasi.wasm file. This is for future debugging purposes. For example, if a crash occurs on a user's machine, the correct error stack can be viewed simply by downloading and replacing the original wasm file with this one. We'll optimize this part of the process when we have more time in the future. |
@Brooooooklyn Ah, I see. I'll put back them with a comment then 👍 |
<!-- Thank you for contributing! -->### DescriptionContext:#4547 (comment)<!-- Please insert your description here and provide especially infoabout the "what" this PR is solving -->
Description
This PR reduces the wasm binary size by tweaking some build options. I guess these were not set to iterate the initial build setup, but we can set it now.
The
debug
andstrip
did not change the binary size. The output binary did not include debug information, so maybe it is stripped by napi-rs.