mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-29 12:37:25 +00:00
d18da3180f
* initial weights job * add artifact * revertme: changes to test branch * add benchmarking instructions * Revert "revertme: changes to test branch" This reverts commit 2eab22037223967e66a70a16fda14f58e41c6ced. * add kusama + westend weights jobs * fix chevdor comments * add temporary changes for testing again * fix * fix * test sccache fix * Revert "add temporary changes for testing again" This reverts commit bb5a7660151f404994c85abfff31502aac89c1d1. * whitespace
42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 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"
|
|
standard_args="--release --locked --features=runtime-benchmarks"
|
|
|
|
echo "[+] Running all benchmarks for $runtime"
|
|
|
|
# shellcheck disable=SC2086
|
|
cargo +nightly run $standard_args 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"
|
|
|
|
# For each pallet found in the previous command, run benches on each function
|
|
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"
|
|
done < "${runtime}_pallets"
|
|
rm "${runtime}_pallets"
|