Update all weights, add run_all_benches.sh script (#3400)

* update all weights

* add run_all_benches.sh
This commit is contained in:
Martin Pugh
2021-07-06 13:12:28 +02:00
committed by GitHub
parent 04ac35e127
commit 5ba0de035e
61 changed files with 1001 additions and 983 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# Runs all benchmarks for all pallets, for each of the runtimes specified below
# Should be run on a reference machine to gain accurate benchmarks
# current reference machine: https://github.com/paritytech/substrate/pull/5848
runtimes=(
polkadot
kusama
westend
)
# cargo build --locked --release
for runtime in "${runtimes[@]}"; do
cargo +nightly run --release --features=runtime-benchmarks --locked benchmark --chain "${runtime}-dev" --execution=wasm --wasm-execution=compiled --pallet "*" --extrinsic "*" --repeat 0 | sed -r -e 's/Pallet: "([a-z_:]+)".*/\1/' | uniq | grep -v frame_system > "${runtime}_pallets"
while read -r line; do
pallet="$(echo "$line" | cut -d' ' -f1)";
echo "Runtime: $runtime. Pallet: $pallet";
cargo +nightly run --release --features=runtime-benchmarks -- benchmark --chain="${runtime}-dev" --steps=50 --repeat=20 --pallet="$pallet" --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output="./runtime/${runtime}/src/weights/${pallet/::/_}.rs"
done < "${runtime}_pallets"
rm "${runtime}_pallets"
done