Skip to content

Commit fc5ca1d

Browse files
authored
Merge pull request #79 from paritytech/oty-enable-instance-benchmarking
Just pass a folder to `benchmark pallet --output`
2 parents 5c07032 + 9ecc060 commit fc5ca1d

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

bench-bot.sh

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ shopt -s inherit_errexit
1414
. "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1515
. "$(dirname "${BASH_SOURCE[0]}")/cmd_runner.sh"
1616

17-
cargo_run_benchmarks="cargo +nightly run --quiet --profile=production"
17+
cargo_run_benchmarks="cargo +nightly run --locked --quiet --profile=production"
1818
repository="$(basename "$PWD")"
1919

2020
bench_pallet_common_args=(
@@ -94,23 +94,17 @@ bench_pallet() {
9494
fi
9595
local weights_dir="./runtime/${runtime_dir}/src/weights"
9696

97-
local output_file=""
98-
if [[ $pallet == *"::"* ]]; then
99-
# translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
100-
output_file="${pallet//::/_}.rs"
101-
fi
102-
10397
case "$kind" in
10498
runtime)
10599
args+=(
106100
--header=./file_header.txt
107-
--output="${weights_dir}/${output_file}"
101+
--output="${weights_dir}/"
108102
)
109103
;;
110104
xcm)
111105
args+=(
112106
--template=./xcm/pallet-xcm-benchmarks/template.hbs
113-
--output="${weights_dir}/xcm/${output_file}"
107+
--output="${weights_dir}/xcm/"
114108
)
115109
;;
116110
*)
@@ -132,23 +126,17 @@ bench_pallet() {
132126
--header=./file_header.txt
133127
)
134128

135-
local output_file=""
136-
if [[ $pallet == *"::"* ]]; then
137-
# translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
138-
output_file="${pallet//::/_}.rs"
139-
fi
140-
141129
case "$kind" in
142130
pallet)
143131
args+=(
144-
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/${output_file}"
132+
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/"
145133
)
146134
;;
147135
xcm)
148136
mkdir -p "./parachains/runtimes/$chain_type/$runtime/src/weights/xcm"
149137
args+=(
150138
--template=./templates/xcm-bench-template.hbs
151-
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/${output_file}"
139+
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/"
152140
)
153141
;;
154142
*)

0 commit comments

Comments
 (0)