Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

no1wudi
Copy link
Contributor

@no1wudi no1wudi commented Nov 18, 2024

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

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]>
Copy link

@cederom cederom left a 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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

@no1wudi no1wudi marked this pull request as draft November 29, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants