Benchmarks script improvements (#2214)

* Benchmarks script improvements

* EOF

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Muharem Ismailov
2023-02-21 11:26:26 +01:00
committed by GitHub
parent 5b42b5fdfa
commit d21bfd7ac5
2 changed files with 26 additions and 67 deletions
+15 -60
View File
@@ -1,70 +1,25 @@
#!/usr/bin/env bash #!/usr/bin/env bash
steps=50
repeat=20
category=$1 category=$1
runtimeName=$2 runtimeName=$2
artifactsDir=$3 artifactsDir=$3
steps=${4:-50}
repeat=${5:-20}
benchmarkOutput=./parachains/runtimes/$category/$runtimeName/src/weights benchmarkOutput=./parachains/runtimes/$category/$runtimeName/src/weights
benchmarkRuntimeName="$runtimeName-dev" benchmarkRuntimeName="$runtimeName-dev"
if [[ $runtimeName == "statemint" ]] || [[ $runtimeName == "statemine" ]] || [[ $runtimeName == "westmint" ]]; then # Load all pallet names in an array.
pallets=( pallets=($(
pallet_assets ${artifactsDir}/polkadot-parachain benchmark pallet --list --chain="${benchmarkRuntimeName}" |\
pallet_balances tail -n+2 |\
pallet_collator_selection cut -d',' -f1 |\
pallet_multisig sort |\
pallet_proxy uniq
pallet_session ))
pallet_timestamp
pallet_utility if [ ${#pallets[@]} -ne 0 ]; then
pallet_uniques echo "[+] Benchmarking ${#pallets[@]} pallets for runtime $runtime"
cumulus_pallet_xcmp_queue
frame_system
pallet_xcm_benchmarks::generic
pallet_xcm_benchmarks::fungible
)
elif [[ $runtimeName == "collectives-polkadot" ]]; then
pallets=(
pallet_alliance
pallet_balances
pallet_collator_selection
pallet_collective
pallet_multisig
pallet_proxy
pallet_session
pallet_timestamp
pallet_utility
cumulus_pallet_xcmp_queue
frame_system
)
elif [[ $runtimeName == "bridge-hub-kusama" ]] || [[ $runtimeName == "bridge-hub-polkadot" ]]; then
pallets=(
frame_system
pallet_balances
pallet_collator_selection
pallet_multisig
pallet_session
pallet_timestamp
pallet_utility
cumulus_pallet_xcmp_queue
pallet_xcm_benchmarks::generic
pallet_xcm_benchmarks::fungible
)
elif [[ $runtimeName == "bridge-hub-rococo" ]]; then
pallets=(
frame_system
pallet_balances
pallet_collator_selection
pallet_multisig
pallet_session
pallet_timestamp
pallet_utility
cumulus_pallet_xcmp_queue
pallet_xcm_benchmarks::generic
pallet_xcm_benchmarks::fungible
)
else else
echo "$runtimeName pallet list not found in benchmarks-ci.sh" echo "$runtimeName pallet list not found in benchmarks-ci.sh"
exit 1 exit 1
@@ -75,10 +30,10 @@ do
output_file="${pallet//::/_}" output_file="${pallet//::/_}"
extra_args="" extra_args=""
# a little hack for pallet_xcm_benchmarks - we want to force custom implementation for XcmWeightInfo # a little hack for pallet_xcm_benchmarks - we want to force custom implementation for XcmWeightInfo
if [[ "$pallet" == "pallet_xcm_benchmarks::generic" ]] || [[ "$pallet" == "pallet_xcm_benchmarks::fungible" ]]; then if [[ "$pallet" == "pallet_xcm_benchmarks::generic" ]] || [[ "$pallet" == "pallet_xcm_benchmarks::fungible" ]]; then
output_file="xcm/$output_file" output_file="xcm/$output_file"
extra_args="--template=./templates/xcm-bench-template.hbs" extra_args="--template=./templates/xcm-bench-template.hbs"
fi fi
$artifactsDir/polkadot-parachain benchmark pallet \ $artifactsDir/polkadot-parachain benchmark pallet \
$extra_args \ $extra_args \
--chain=$benchmarkRuntimeName \ --chain=$benchmarkRuntimeName \
+11 -7
View File
@@ -1,13 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
target=${1:-production}
steps=${2:-50}
repeat=${3:-20}
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
${__dir}/benchmarks-ci.sh collectives collectives-polkadot target/production ${__dir}/benchmarks-ci.sh collectives collectives-polkadot target/$target $steps $repeat
${__dir}/benchmarks-ci.sh assets statemine target/production ${__dir}/benchmarks-ci.sh assets statemine target/$target $steps $repeat
${__dir}/benchmarks-ci.sh assets statemint target/production ${__dir}/benchmarks-ci.sh assets statemint target/$target $steps $repeat
${__dir}/benchmarks-ci.sh assets westmint target/production ${__dir}/benchmarks-ci.sh assets westmint target/$target $steps $repeat
${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-polkadot target/production ${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-polkadot target/$target $steps $repeat
${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-kusama target/production ${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-kusama target/$target $steps $repeat
${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-rococo target/production ${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-rococo target/$target $steps $repeat