-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Right now e.g. -O3 -gsource-map
is not fully optimized: we do optimize the wasm code fully, but it has some properties of a debug build, like the JS is not minified, and there is a names section. emcc.py
sets the debug level to 3 when it sees -gsource-map
which causes the rest of the effects.
It would be useful to optionally fully optimize. Then the source map could be used like a symbol map for crashes, to symbolize them, and not just with function names but locations as well. (edit: fully optimized builds can be symbolized using emcc --emit-symbol-map
, which gives proper function names, but not line:column
positions inside functions)
I'm not sure if we should do this as a breaking change. On the one hand it is on a debug build, so shrinking size wouldn't regress people's production builds, but it could interfere with debug workflows people are used to. On the other hand, adding a new flag for this is annoying.