From 7e966a7fb597d0494790402d855fa535f24b6b72 Mon Sep 17 00:00:00 2001 From: Hein Dauven Date: Thu, 15 Aug 2024 23:28:08 +0200 Subject: [PATCH 1/2] makefile: Add Rusk bench --- Makefile | 5 ++++- rusk/Makefile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fd4aa6d6c8..4877216e23 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,9 @@ doc: ## Run doc gen $(MAKE) -C ./rusk-recovery $@ $(MAKE) -C ./wallet-core/ $@ +bench: keys wasm ## Bench Rusk + $(MAKE) -C ./rusk bench + run: keys state web-wallet ## Run the server $(MAKE) -C ./rusk/ $@ @@ -79,4 +82,4 @@ COMPILER_VERSION=v0.2.0 setup-compiler: ## Setup the Dusk Contract Compiler @./scripts/setup-compiler.sh $(COMPILER_VERSION) -.PHONY: all abi keys state wasm allcircuits contracts test run help rusk web-wallet setup-compiler +.PHONY: all abi keys state wasm allcircuits contracts test bench run help rusk web-wallet setup-compiler diff --git a/rusk/Makefile b/rusk/Makefile index 43233cf45e..c95a0ef68f 100644 --- a/rusk/Makefile +++ b/rusk/Makefile @@ -48,6 +48,9 @@ build: ## Build rusk binary build-bench: ## Build the benchmarks @cargo bench --features testwallet --no-run +bench: ## Run the benchmarks + @cargo bench --features testwallet + run: @cargo r --release --bin rusk @@ -66,4 +69,4 @@ recovery-state: ## Build network state -- recovery-state \ --init $(INITFILE) -.PHONY: test help clippy build build-bench recovery-keys recovery-state rusk +.PHONY: test help clippy build build-bench bench recovery-keys recovery-state rusk From 5b231102420a83468a375eb5ca1eec162c38a0ce Mon Sep 17 00:00:00 2001 From: Hein Dauven Date: Thu, 15 Aug 2024 23:31:45 +0200 Subject: [PATCH 2/2] ci: Add benchmark job to Rusk CI --- .github/workflows/rusk_ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/rusk_ci.yml b/.github/workflows/rusk_ci.yml index e8b20b8330..02c11570d7 100644 --- a/.github/workflows/rusk_ci.yml +++ b/.github/workflows/rusk_ci.yml @@ -75,3 +75,18 @@ jobs: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - run: cargo fmt --all -- --check + benchmark: + needs: changes + if: needs.changes.outputs.run-ci == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master' + name: Run Benchmarks + runs-on: core + steps: + - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - run: make bench + - name: Upload Benchmark Results + uses: actions/upload-artifact@v4 + with: + name: rusk-benchmark-results + path: ./target/criterion + retention-days: 14