Skip to content

wasm-bindgen introduces potential panics into code #4203

Answered by daxpedda
newpavlov asked this question in Q&A
Discussion options

You must be logged in to vote
[profile.release]
panic = "abort"

This is the default on wasm32-unknown-unknown btw.

results in a much bigger file, which includes allocator and potential panic paths. This not only bloats size of generated WASM files, but also makes it harder to write robust code which attempts to "prove" that it does not contain any potential panics.

I'm going to assume that you have done the post-processing with the CLI here.

The only difference I can see is a data segment, that is unreferenced.
The data segment doesn't do anything, it just holds a bunch of unused strings that as you say bloat the resulting Wasm module.

wasm-bindgen works by inserting functions into the module, which are executed b…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by newpavlov
Comment options

You must be logged in to vote
2 replies
@daxpedda
Comment options

@newpavlov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #4199 on October 15, 2024 20:00.