This issue tracks part of our shrinking initiative, which is Option 1 from #5794. The goal is to shrink the JS and wasm we emit by default. See details in that previous discussion.
To get things started, I looked at one testcase - we should look at more, hence the testcase #1 in the title, this is just to get started. The testcase is a "pure computation" library,
#include <emscripten.h>
EMSCRIPTEN_KEEPALIVE
int add(int x, int y) {
return x + y;
}
and I built it with -Os --closure 1 -g1 -s WASM=1, then counted lines in the JS. Starting point: 10K of wasm and 24K of JS when fully minified, or when built as I did with -g1 for convenience, it is 32K, in 1,143 lines. In more detail:
Also
If you want to work on one of these, open an issue or a PR, and we can add a link from here.
This issue tracks part of our shrinking initiative, which is Option 1 from #5794. The goal is to shrink the JS and wasm we emit by default. See details in that previous discussion.
To get things started, I looked at one testcase - we should look at more, hence the
testcase #1in the title, this is just to get started. The testcase is a "pure computation" library,and I built it with
-Os --closure 1 -g1 -s WASM=1, then counted lines in the JS. Starting point: 10K of wasm and 24K of JS when fully minified, or when built as I did with-g1for convenience, it is 32K, in 1,143 lines. In more detail:asm(all theModule.x = get the thing from asm.xetc).Also
If you want to work on one of these, open an issue or a PR, and we can add a link from here.