Skip to content

JS and wasm shrinking (testcase #1) #5836

Closed
@kripken

Description

@kripken

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions