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

feat: Add strip passes to remove debug information #56

Merged
merged 2 commits into from
Sep 30, 2021

Conversation

saulecabrera
Copy link
Member

@saulecabrera saulecabrera commented Sep 30, 2021

Follow up to #54

This PR runs the custom strip pass on top of binaryen's default passes. This restores the previous binary size of 1MB:

twiggy top -n 20  build/index.wasm                                                                                              20:24:05
 Shallow Bytes │ Shallow % │ Item
───────────────┼───────────┼─────────────────────
         41184 ┊     4.04% ┊ code[375]
         26104 ┊     2.56% ┊ code[749]
         14166 ┊     1.39% ┊ code[761]
         13257 ┊     1.30% ┊ code[593]
         13017 ┊     1.28% ┊ code[741]
         10227 ┊     1.00% ┊ code[759]
         10133 ┊     0.99% ┊ code[746]
          9805 ┊     0.96% ┊ code[748]
          8723 ┊     0.86% ┊ code[1124]
          8319 ┊     0.82% ┊ data[363]
          8183 ┊     0.80% ┊ code[218]
          8105 ┊     0.80% ┊ code[752]
          7668 ┊     0.75% ┊ data[3818]
          6531 ┊     0.64% ┊ code[1083]
          6029 ┊     0.59% ┊ code[349]
          5549 ┊     0.54% ┊ code[314]
          5547 ┊     0.54% ┊ code[662]
          5371 ┊     0.53% ┊ code[736]
          4970 ┊     0.49% ┊ code[395]
          4962 ┊     0.49% ┊ code[568]
        801294 ┊    78.62% ┊ ... and 7003 more.
       1019144 ┊   100.00% ┊ Σ [7023 Total Rows]

Copy link
Contributor

@smacleodify smacleodify left a comment

Choose a reason for hiding this comment

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

👍

crates/cli/src/opt.rs Outdated Show resolved Hide resolved
Co-authored-by: Steven MacLeod <84392659+smacleodify@users.noreply.github.com>
@saulecabrera saulecabrera merged commit bbb1211 into main Sep 30, 2021
@saulecabrera saulecabrera deleted the add-strip-passes branch September 30, 2021 15:05
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.

None yet

2 participants