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

chore(wasm): 🤖 reduce WASM binary size #187

Merged
merged 12 commits into from
Jun 26, 2024
Merged

Conversation

theashraf
Copy link
Member

@theashraf theashraf commented Jun 23, 2024

Description:

This PR introduces optimizations to reduce the size of the WASM binary and the accompanying JavaScript glue code.

Changes:

  • WASM Binary Optimization:

    • Applied the -Oz flag with emcc for size optimization.
    • Use the compact emmalloc allocator.
    • Use the Rust nightly toolchain to remove location details and panic string formatting for a smaller binary size.
    • Current Size: 1,245,102 bytes
    • New Size: 1,099,243 bytes
    • Reduction: ~142 KB
  • JavaScript Glue Optimization:

    • Enabled the Closure Compiler with the --closure=1 flag.
    • Current Size: 67,964 bytes
    • New Size: 30,197 bytes
    • Reduction: ~36.88 KB

related #107

Copy link

changeset-bot bot commented Jun 23, 2024

🦋 Changeset detected

Latest commit: aeac3b6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@afsalz afsalz left a comment

Choose a reason for hiding this comment

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

Looks good

@theashraf theashraf merged commit 1f46680 into main Jun 26, 2024
1 check passed
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.

2 participants