blob: ea4ecded3b4e8e05a0694b21b654d1eb578a0fc5 (
plain)
1
2
3
4
5
6
7
8
9
10
|
#!/bin/sh
mkdir -p target
cd examples/wasm-minipng && cargo b --release && cd ../.. && wasm-opt --strip-debug -Oz examples/wasm-minipng/target/wasm32-unknown-unknown/release/wasm_minipng.wasm -o target/minipng.wasm && gzip -k -f target/minipng.wasm || exit 1
cd examples/wasm-png && cargo b --release && cd ../.. && wasm-opt --strip-debug -Oz examples/wasm-png/target/wasm32-unknown-unknown/release/wasm_png.wasm -o target/png.wasm && gzip -k -f target/png.wasm || exit 1
wc -c target/png.wasm.gz target/minipng.wasm.gz | head -n2
pngsz=$(wc -c target/png.wasm.gz | cut -d' ' -f1)
minipngsz=$(wc -c target/minipng.wasm.gz | cut -d' ' -f1)
echo 'Ratio: '$(python3 -c "print($pngsz / $minipngsz)")
|