-
Notifications
You must be signed in to change notification settings - Fork 587
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
tools: Optimize size by wasm-opt #2858
base: master
Are you sure you want to change the base?
Conversation
wasm-opt is a tool from binaryen that can do further optimization for Wasm module, to reduce the size of bytecode. Signed-off-by: Huang Qi <[email protected]>
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.
Thank you @no1wudi :-)
Do we want to have it as option? You say this tool is experimental so maybe its good to make it optional just in case it produces broken binary? :-)
Does CMake build is in sync with Make build both will have this optimization enabled?
@@ -42,7 +42,12 @@ define LINK_WASM | |||
$(if $(RETVAL), \ | |||
$(error wasm build failed for $(PROGNAME).wasm) \ | |||
) \ | |||
$(call WAMR_AOT_COMPILE) \ | |||
$(eval RETVAL=$(shell $(WASI_SDK_PATH)/wasm-opt -Oz -o $(BINDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm \ |
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.
- as far as i know, wasi-sdk doesn't have wasm-opt.
- see also: Add flag to opt out of wasm-opt llvm/llvm-project#95208
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.
Yes, it's from binaryen, I'll update the tool path
ping :-) |
Summary
wasm-opt is a tool from binaryen that can do
further optimization for Wasm module, to reduce
the size of bytecode.
Impact
New experimental feature, for wasm build
Testing
Local machine