Skip to content

tools: Optimize size by wasm-opt #2858

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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 <huangqi3@xiaomi.com>
Copy link
Contributor

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

cederom commented Jan 30, 2025

ping :-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants