-
Notifications
You must be signed in to change notification settings - Fork 9
Profile wasm-opt level 3 #35
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
Conversation
Heartbeat / TimerMeasure the cost of empty heartbeat and timer job.
Heartbeat
Timer
Collection librariesMeasure different collection libraries written in both Motoko and Rust. We use the same random number generator with fixed seed to ensure that all collections contain
💎 Takeaways
Map
Priority queue
MoVM
Publisher & SubscriberMeasure the cost of inter-canister calls from the Publisher & Subscriber example.
Sample DappsMeasure the performance of some typical dapps:
Basic DAO
DIP721 NFT
Motoko Garbage CollectionMeasure Motoko garbage collection cost using the Triemap benchmark. The max mem column reports
|
Heartbeat
Timer
Map
Priority queue
MoVM
Publisher & Subscriber
Basic DAO
DIP721 NFT
Motoko Garbage Collection
|
[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" } } ```
No description provided.