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

Avoid repeating wasm data in SINGLE_FILE mode with closure. NFC #23967

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Mar 21, 2025

This change removes the wasmBinaryFile global in SINGLE_FILE mode. Instead, the wasmBinaryFile is inlined into the createWasm function.

As part of this change we now also use the same embedding method as is used in MINIMAL_RUNTIME, avoiding the need for the tryParseAsDataURI helper.

Fixes: #23938

Copy link
Collaborator Author

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

See the huge reduction in test/other/codesize/test_codesize_hello_single_file.jssize

@sbc100 sbc100 requested a review from kripken March 21, 2025 19:39
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Nice!

@sbc100 sbc100 force-pushed the binary_file branch 4 times, most recently from 994171c to aaa5f68 Compare March 24, 2025 17:17
This change removes the `wasmBinaryFile` global in SINGLE_FILE mode.
Instead the `wasmBinaryFile` is inlined into the `createWasm` function.

As part of this change we now also use the same embedding method as is
used in `MINIMAL_RUNTIME`, avoiding the need for the `tryParseAsDataURI`
helper.

Fixes: emscripten-core#23938
@sbc100 sbc100 merged commit 975084c into emscripten-core:main Mar 24, 2025
24 checks passed
@sbc100 sbc100 deleted the binary_file branch March 24, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Size of base64 encoded WASM more than doubled going from 3.1.74 to 4.0.0
2 participants