Skip to content
This repository is used for reproducing a size issue when compiling code to WASM.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Cargo.lock
Cargo.toml
README.md
run.sh

README.md

This repository is used for reproducing a size issue when compling code to WASM.

To get things compiled, you'll need nightly toolchain and target "wasm32-unknown-unknown", which can be installed as follow:

rustup toolchain install nightly
rustup target add wasm32-unknown-unknown

Then you can run following command to compile code:

cargo +nightly build --target=wasm32-unknown-unknown --release

Or use shell script:

./run.sh

The WASM file is located at target/wasm32-unknown-unknown/release/wasm_size_bug.wasm.

rustc 1.28.0-nightly (2a1c4eec4 2018-06-25)

In my macOS with rustc 1.28.0-nightly (2a1c4eec4 2018-06-25), the binary is about 639K.

rustc 1.31.0-nightly (4efdc04a5 2018-10-06)

With LTO enabled, it's 52KB now.

rustc 1.33.0-nightly (ceb251214 2019-01-16)

It's 63KB now. No idea why it is going backwards.

You can’t perform that action at this time.