Add twiggy to profile each example
#!/bin/bash
set -e
-rm -rf wasm_sizer
-git clone https://github.com/near/wasm_sizer
-pip3 install --user numpy matplotlib octopus
+cargo install twiggy
-for contract in $(ls examples/*/res/*.wasm); do
+for contract in ./examples/*/; do
+ (
+ cd "$contract";
+ contract=$(basename "$contract")
echo "Size contract $contract"
- python3 wasm_sizer/sizer.py --input $contract --sections --silent
+ RUSTFLAGS='-C debuginfo=2' cargo build --release --target wasm32-unknown-unknown
+ cp target/wasm32-unknown-unknown/release/*.wasm res/
+ for wasm in ./res/*.wasm; do
+ twiggy dominators -d 4 -r 100 "$wasm"
+ done
+ )
done
