Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions commands/bench-all/bench-all.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@
"description": "Pallet Benchmark for Cumulus",
"repos": ["polkadot-sdk"],
"args": {
"runtime": {
"label": "Runtime",
"type_one_of": [
"asset-hub-kusama",
"asset-hub-polkadot",
"asset-hub-rococo",
"asset-hub-westend",
"bridge-hub-kusama",
"bridge-hub-polkadot",
"bridge-hub-rococo",
"bridge-hub-westend",
"collectives-polkadot",
"collectives-westend",
"coretime-rococo",
"coretime-westend",
"contracts-rococo",
"glutton-kusama",
"glutton-westend"
]
},
"target_dir": { "label": "Target Directory", "type_string": "cumulus" }
}
},
Expand Down
65 changes: 52 additions & 13 deletions commands/bench/lib/bench-all-cumulus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# default RUST_LOG is warn, but could be overridden
export RUST_LOG="${RUST_LOG:-error}"

. "$BENCH_ROOT_DIR/../utils.sh"

POLKADOT_PARACHAIN="./target/$profile/polkadot-parachain"

run_cumulus_bench() {
Expand Down Expand Up @@ -74,20 +76,57 @@ run_cumulus_bench() {
echo "[+] Compiling benchmarks..."
cargo build --profile $profile --locked --features=runtime-benchmarks -p polkadot-parachain-bin

# Assets
run_cumulus_bench assets asset-hub-westend
run_cumulus_bench assets asset-hub-rococo
# Run benchmarks for all pallets of a given runtime if runtime argument provided
get_arg optional --runtime "$@"
runtime="${out:-""}"

if [[ $runtime ]]; then
paraId=""
case "$runtime" in
asset-*)
category="assets"
;;
collectives-*)
category="collectives"
;;
coretime-*)
category="coretime"
;;
bridge-*)
category="bridge-hubs"
;;
contracts-*)
category="contracts"
;;
glutton-*)
category="glutton"
paraId="1300"
;;
*)
echo "Unknown runtime: $runtime"
exit 1
;;
esac

run_cumulus_bench $category $runtime $paraId

exit 0
Comment thread
mordamax marked this conversation as resolved.
Outdated
Comment thread
mordamax marked this conversation as resolved.
Outdated
else # run all
# Assets
run_cumulus_bench assets asset-hub-rococo
run_cumulus_bench assets asset-hub-westend

# Collectives
run_cumulus_bench collectives collectives-westend
# Collectives
run_cumulus_bench collectives collectives-westend

# Coretime
run_cumulus_bench coretime coretime-rococo
run_cumulus_bench coretime coretime-westend
# Coretime
run_cumulus_bench coretime coretime-rococo
run_cumulus_bench coretime coretime-westend

# Bridge Hubs
run_cumulus_bench bridge-hubs bridge-hub-rococo
run_cumulus_bench bridge-hubs bridge-hub-westend
# Bridge Hubs
run_cumulus_bench bridge-hubs bridge-hub-rococo
run_cumulus_bench bridge-hubs bridge-hub-westend

# Glutton
run_cumulus_bench glutton glutton-westend 1300
# Glutton
run_cumulus_bench glutton glutton-westend 1300
fi