rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.75k stars 210 forks source link

`debug=true` vs `debug=1` #274

Open kazcw opened 2 years ago

kazcw commented 2 years ago

Where in the docs did you come across this?

https://rustwasm.github.io/book/reference/debugging.html#building-with-debug-symbols

Describe what about it does not make sense

The book recommends using debug=true so that symbol information will be available in stack traces, however debug=1 seems to be sufficient for informative stack traces.

Why does it not make sense?

I'm working on a project where the intermediate WASM file passed from rustc to wasm-pack is 3.3GB with debug=true. With debug=1, the same file is 0.5GB. This difference corresponds to more than a factor of 2 difference in build times in a common incremental case.

How could we improve it?

Recommend debug=1; or if the extra data produced by debug=true is useful in some way, mention the difference.