mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
[ci] scripts: don't rebuild for every pallet benchmark (#5126)
* scripts: don't rebuild for every pallet benchmark * ci: remove orphan variable * [ci] run_benches_for_runtime.sh: explicit relative path names * [ci] scripts: handle failing benchmarks
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Runs all benchmarks for all pallets, for a given runtime, provided by $1
|
||||
# Should be run on a reference machine to gain accurate benchmarks
|
||||
# current reference machine: https://github.com/paritytech/substrate/pull/5848
|
||||
|
||||
runtime="$1"
|
||||
profile="$2"
|
||||
standard_args="--profile $profile --locked --features=runtime-benchmarks"
|
||||
|
||||
echo "[+] Running all benchmarks for $runtime"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cargo +nightly run $standard_args benchmark \
|
||||
cargo +nightly build --profile production --locked --features=runtime-benchmarks
|
||||
|
||||
./target/production/polkadot benchmark \
|
||||
--chain "${runtime}-dev" \
|
||||
--list |\
|
||||
tail -n+2 |\
|
||||
@@ -23,17 +24,17 @@ cargo +nightly run $standard_args benchmark \
|
||||
while read -r line; do
|
||||
pallet="$(echo "$line" | cut -d' ' -f1)";
|
||||
echo "Runtime: $runtime. Pallet: $pallet";
|
||||
# shellcheck disable=SC2086
|
||||
cargo +nightly run $standard_args -- 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"
|
||||
# '!' has the side effect of bypassing errexit / set -e
|
||||
! ./target/production/polkadot 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"
|
||||
|
||||
Reference in New Issue
Block a user