Skip to content

Commit

Permalink
fix(benchmarks): Create files with weights beforehand (#4339)
Browse files Browse the repository at this point in the history
  • Loading branch information
gshep authored Nov 17, 2024
1 parent f7514cf commit 27c1478
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/test-measurements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,9 @@ jobs:
--output-file ./target/action-pallet-output.json
- name: "Collect: pallet-gear benches"
run: >-
./target/release/gear benchmark pallet --pallet=pallet_gear
--steps=50
--repeat=20
--chain=dev
--extrinsic=*
--heap-pages=4096
--json-file ./target/weights.json
--template ./.maintain/regression-analysis-weight-template.hbs
run: |
touch ./target/weights.json
./target/release/gear benchmark pallet --pallet=pallet_gear --steps=50 --repeat=20 --chain=dev --extrinsic=* --heap-pages=4096 --output ./target/weights.json --template ./.maintain/regression-analysis-weight-template.hbs
- name: "Generate report: pallet-gear benches"
run: |
Expand Down
2 changes: 2 additions & 0 deletions scripts/benchmarking/run_all_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ for PALLET in "${PALLETS[@]}"; do
fi

WEIGHT_FILE="./${WEIGHTS_OUTPUT}/${PALLET}.rs"
touch "$WEIGHT_FILE"
echo "[+] Benchmarking $PALLET with weight file $WEIGHT_FILE";

OUTPUT=$(
Expand All @@ -204,6 +205,7 @@ for PALLET in "${PALLETS[@]}"; do
if [ "$PALLET" == "pallet_gear" ]
then
echo "[+] Benchmarking $PALLET one-time syscalls with weight file ./${WEIGHTS_OUTPUT}/${PALLET}_onetime.rs";
touch "./${WEIGHTS_OUTPUT}/${PALLET}_onetime.rs"
OUTPUT=$(
$TASKSET_CMD $GEAR benchmark pallet \
--chain="$chain_spec" \
Expand Down

0 comments on commit 27c1478

Please sign in to comment.