Skip to content

Commit

Permalink
Reduce the size of the wasp1 component adapter by 4.6k (#8858)
Browse files Browse the repository at this point in the history
This reduces the size of wasi_snapshot_preview1.command.wasm from 79625
bytes to 75029 bytes for a total win of 4596 bytes. Of this reduction
enabling LTO is responsible for 3103 bytes, while enabling bulk-memory
is responsible for 1493 bytes
  • Loading branch information
bjorn3 authored Jun 21, 2024
1 parent 896e25e commit 1088b41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ci/build-wasi-preview1-component-adapter.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env bash
set -ex

# These flags reduce binary size by a combined 4.6k
export CARGO_PROFILE_RELEASE_LTO=fat
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS="$RUSTFLAGS -Ctarget-feature=+bulk-memory"

build_adapter="cargo build -p wasi-preview1-component-adapter --target wasm32-unknown-unknown"
verify="cargo run -p verify-component-adapter --"

Expand Down

0 comments on commit 1088b41

Please sign in to comment.