From 1c24363b8f6c31a14d98bed98664017783eecef5 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 20 Sep 2022 11:08:32 +0100 Subject: [PATCH 1/2] xcm benchmarks use a custom template --- scripts/benchmarks-ci.sh | 51 ++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index 6ac63e9ab34..6b181cf810e 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -22,28 +22,53 @@ if [[ $runtimeName == "statemint" ]] || [[ $runtimeName == "statemine" ]] || [[ pallet_uniques cumulus_pallet_xcmp_queue frame_system + ) + xcm_pallets=( 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 - ) + 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 + ) + xcm_pallets=( + ) else echo "$runtimeName pallet list not found in benchmarks-ci.sh" exit 1 fi +for pallet in ${xcm_pallets[@]} +do + # a little hack for xcm benchmarks + output_file="${pallet//::/_}" + if [[ "$pallet" == *"xcm"* ]]; then + output_file="xcm/$output_file" + fi + $artifactsDir/polkadot-parachain benchmark pallet \ + --template=./templates/xcm-bench-template.hbs \ + --chain=$benchmarkRuntimeName \ + --execution=wasm \ + --wasm-execution=compiled \ + --pallet=$pallet \ + --extrinsic='*' \ + --steps=$steps \ + --repeat=$repeat \ + --json \ + --header=./file_header.txt \ + --output="${benchmarkOutput}/${output_file}.rs" >> $artifactsDir/${pallet}_benchmark.json +done + for pallet in ${pallets[@]} do # a little hack for xcm benchmarks From 7ee2a1ab0b7d069e6b5bb6cc268ea4f45da3dfaf Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 20 Sep 2022 12:37:06 +0100 Subject: [PATCH 2/2] nicer way to do it --- scripts/benchmarks-ci.sh | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index 6b181cf810e..72e1e2fbf5c 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -22,8 +22,6 @@ if [[ $runtimeName == "statemint" ]] || [[ $runtimeName == "statemine" ]] || [[ pallet_uniques cumulus_pallet_xcmp_queue frame_system - ) - xcm_pallets=( pallet_xcm_benchmarks::generic pallet_xcm_benchmarks::fungible ) @@ -41,42 +39,22 @@ elif [[ $runtimeName == "collectives-polkadot" ]]; then cumulus_pallet_xcmp_queue frame_system ) - xcm_pallets=( - ) else echo "$runtimeName pallet list not found in benchmarks-ci.sh" exit 1 fi -for pallet in ${xcm_pallets[@]} -do - # a little hack for xcm benchmarks - output_file="${pallet//::/_}" - if [[ "$pallet" == *"xcm"* ]]; then - output_file="xcm/$output_file" - fi - $artifactsDir/polkadot-parachain benchmark pallet \ - --template=./templates/xcm-bench-template.hbs \ - --chain=$benchmarkRuntimeName \ - --execution=wasm \ - --wasm-execution=compiled \ - --pallet=$pallet \ - --extrinsic='*' \ - --steps=$steps \ - --repeat=$repeat \ - --json \ - --header=./file_header.txt \ - --output="${benchmarkOutput}/${output_file}.rs" >> $artifactsDir/${pallet}_benchmark.json -done - for pallet in ${pallets[@]} do # a little hack for xcm benchmarks output_file="${pallet//::/_}" + extra_args="" if [[ "$pallet" == *"xcm"* ]]; then output_file="xcm/$output_file" + extra_args="--template=./templates/xcm-bench-template.hbs" fi $artifactsDir/polkadot-parachain benchmark pallet \ + $extra_args \ --chain=$benchmarkRuntimeName \ --execution=wasm \ --wasm-execution=compiled \