Skip to content

Commit 3bc76ee

Browse files
perf: cargo wasm builds compiler.wasm alone, smaller and faster
1 parent 03a5cb1 commit 3bc76ee

3 files changed

Lines changed: 5215 additions & 5205 deletions

File tree

‎.cargo/config.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# `cargo wasm` build edge-python release WebAssembly artifact.
22
[alias]
3-
wasm = "rustc --release --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib,rlib"
3+
wasm = "rustc --release --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib"
44
# `cargo wasm-cli` builds the speed-tuned copy released CLIs embed.
5-
wasm-cli = "rustc --profile cli --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib,rlib"
5+
wasm-cli = "rustc --profile cli --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib"

‎.github/actions/compiler/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ runs:
6767
-p edge-python \
6868
--no-default-features \
6969
--features runtime \
70-
--crate-type cdylib,rlib \
70+
--crate-type cdylib \
7171
-Z build-std=std,panic_abort \
7272
-Z build-std-features=optimize_for_size
7373
@@ -114,7 +114,7 @@ runs:
114114
- name: Build (CLI)
115115
shell: bash
116116
run: |
117-
cargo rustc --locked --profile cli --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib,rlib
117+
cargo rustc --locked --profile cli --target wasm32-unknown-unknown -p edge-python --lib --no-default-features --features runtime --crate-type cdylib
118118
CLI_WASM=target/wasm32-unknown-unknown/cli/compiler.wasm
119119
wasm-opt -O3 --enable-bulk-memory --enable-bulk-memory-opt --enable-nontrapping-float-to-int --enable-sign-ext --enable-mutable-globals --enable-multivalue --enable-reference-types -o /tmp/compiler-cli.wasm "$CLI_WASM"
120120
mv /tmp/compiler-cli.wasm "$CLI_WASM"

0 commit comments

Comments
 (0)