-
Notifications
You must be signed in to change notification settings - Fork 6
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-opt integration #28
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kentosugama
commented
Apr 10, 2023
kentosugama
commented
Apr 10, 2023
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.
Remember to bump ic-wasm version number.
chenyan-dfinity
approved these changes
Apr 13, 2023
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.
LGTM
@chenyan-dfinity thanks for all feedback! |
12 tasks
mergify bot
pushed a commit
to dfinity/sdk
that referenced
this pull request
Apr 21, 2023
[LANG-124](https://dfinity.atlassian.net/browse/LANG-124) [Profiling data](https://docs.google.com/document/d/1ICXF083-hfRZr2OfRUk8OxmZqYDQL4XINHQ0FXuDqTA/edit) suggests that it would be useful to take advantage of the performance and binary size wasm optimizations offered by [`wasm-opt`](https://github.com/WebAssembly/binaryen). See also results in the [canister profiling repo](dfinity/canister-profiling#35). This tool has been integrated with `ic-wasm` in this PR: dfinity/ic-wasm#28. The tool is added under the `shrink` command that is currently used in `dfx` to perform binary size reduction of canisters. The next step is to expose this feature to users by allowing users to opt into the optimizer and specify the optimization level in `dfx.json`. Then to invoke `ic-wasm` in `dfx` according to this argument, similarly to `shrink`. Note: This tool has been used in the past to perform binary size reductions for canisters, but was replaced because it deletes the custom metadata sections from wasm modules. The `ic-wasm` feature invokes `wasm-opt` while preserving these sections. Example usage in `dfx.json`: ``` "canisters" : { "backend" : { "optimize" : "cycles" } } ```
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Profiling data suggests that it would be useful to take advantage of the performance and binary size optimizations offered by
wasm-opt
.See also results in the canister profiling repo.
To do so, it is necessary to correctly preserve the ic custom sections. Furthermore, it would be best to recursively optimize embedded modules in the data sections used by Motoko actor classes.
ic-wasm
is a good tool for this job since it already parses wasm modules, including the extraction of embedded actors in the data section.TODO items left:
unwrap
)Also check:
wasm-opt
in memory only. see here