3d55bfbcd9
- Rename CLI argument --pallet to --pezpallet (with --pallet as alias) - Rename --pallets to --pezpallet, --exclude-pallets to --exclude-pezpallets - Update benchmark subcommand from 'pallet' to 'pezpallet' - Rename check-frame-omni-bencher.yml to check-pezframe-omni-bencher.yml - Update all benchmark scripts to use new argument names - Update cmd.py to use pezframe-omni-bencher and --pezpallet
55 lines
2.3 KiB
Bash
Executable File
55 lines
2.3 KiB
Bash
Executable File
# run this, then copy all files to `bizinikiwi/pezframe/election-provider-multi-block/src/weights/`
|
|
source ~/.zshrc
|
|
|
|
STEPS=2
|
|
REPEAT=2
|
|
|
|
# if any of the command line arguments are equal to `--log=X`, set X to the below log levels
|
|
LOG="runtime::multiblock-election=info,runtime::staking-async=info,pezkuwi_sdk_frame::benchmark=info"
|
|
|
|
if [[ "${NO_COMPILE}" == "1" ]]; then
|
|
echo "Skipping compilation because 'NO_COMPILE' was set"
|
|
else
|
|
cargo build --release -p pezframe-omni-bencher
|
|
FORCE_WASM_BUILD=$RANDOM WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} cargo build --release -p pezpallet-staking-async-teyrchain-runtime --features runtime-benchmarks
|
|
fi
|
|
|
|
WASM_BLOB_PATH=../../../../../target/release/wbuild/pezpallet-staking-async-teyrchain-runtime/pezpallet_staking_async_teyrchain_runtime.compact.wasm
|
|
|
|
echo "WASM_BLOB_PATH: $WASM_BLOB_PATH"
|
|
echo "Last modified date of WASM_BLOB:"
|
|
stat -f "%Sm" $WASM_BLOB_PATH
|
|
|
|
run_benchmark() {
|
|
local pallet_name="$1"
|
|
local genesis_preset="$2"
|
|
local output_file="./${pallet_name}_${genesis_preset}.rs"
|
|
|
|
echo "Running benchmark for pallet '$pallet_name' with preset '$genesis_preset'..."
|
|
echo "Outputting to '$output_file'"
|
|
|
|
WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} \
|
|
../../../../../target/release/pezframe-omni-bencher v1 benchmark pezpallet \
|
|
--pezpallet "$pallet_name" \
|
|
--extrinsic "*" \
|
|
--runtime "$WASM_BLOB_PATH" \
|
|
--steps "$STEPS" \
|
|
--repeat "$REPEAT" \
|
|
--genesis-builder-preset "$genesis_preset" \
|
|
--template "../../../../../bizinikiwi/pezframe/election-provider-multi-block/src/template.hbs" \
|
|
--heap-pages 65000 \
|
|
--output "$output_file"
|
|
}
|
|
|
|
# run_benchmark "pallet_staking_async" "fake-hez"
|
|
run_benchmark "pallet_election_provider_multi_block" "fake-hez"
|
|
run_benchmark "pallet_election_provider_multi_block_signed" "fake-hez"
|
|
run_benchmark "pallet_election_provider_multi_block_unsigned" "fake-hez"
|
|
run_benchmark "pallet_election_provider_multi_block_verifier" "fake-hez"
|
|
|
|
# run_benchmark "pallet_staking_async" "fake-ksm"
|
|
run_benchmark "pallet_election_provider_multi_block" "fake-ksm"
|
|
run_benchmark "pallet_election_provider_multi_block_signed" "fake-ksm"
|
|
run_benchmark "pallet_election_provider_multi_block_unsigned" "fake-ksm"
|
|
run_benchmark "pallet_election_provider_multi_block_verifier" "fake-ksm"
|