From 55664535fcfcd32d5db1da462f365e556307fb47 Mon Sep 17 00:00:00 2001 From: Georgy Shepelev Date: Fri, 15 Nov 2024 12:21:43 +0400 Subject: [PATCH 1/2] create files with weights beforehand --- .github/workflows/test-measurements.yaml | 5 +++-- scripts/benchmarking/run_all_benchmarks.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-measurements.yaml b/.github/workflows/test-measurements.yaml index 3123fc5d66b..8bc267d7f68 100644 --- a/.github/workflows/test-measurements.yaml +++ b/.github/workflows/test-measurements.yaml @@ -55,14 +55,15 @@ jobs: --output-file ./target/action-pallet-output.json - name: "Collect: pallet-gear benches" - run: >- + run: | + touch ./target/weights.json ./target/release/gear benchmark pallet --pallet=pallet_gear --steps=50 --repeat=20 --chain=dev --extrinsic=* --heap-pages=4096 - --json-file ./target/weights.json + --output ./target/weights.json --template ./.maintain/regression-analysis-weight-template.hbs - name: "Generate report: pallet-gear benches" diff --git a/scripts/benchmarking/run_all_benchmarks.sh b/scripts/benchmarking/run_all_benchmarks.sh index d462dc50065..37d9eaeee74 100755 --- a/scripts/benchmarking/run_all_benchmarks.sh +++ b/scripts/benchmarking/run_all_benchmarks.sh @@ -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=$( @@ -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" \ From 38fc313e613322d7a388d755cd767a820f283583 Mon Sep 17 00:00:00 2001 From: Georgy Shepelev Date: Fri, 15 Nov 2024 14:40:35 +0400 Subject: [PATCH 2/2] edit workflow --- .github/workflows/test-measurements.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test-measurements.yaml b/.github/workflows/test-measurements.yaml index 8bc267d7f68..897622f957f 100644 --- a/.github/workflows/test-measurements.yaml +++ b/.github/workflows/test-measurements.yaml @@ -57,14 +57,7 @@ jobs: - name: "Collect: pallet-gear benches" 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 + ./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: |