From 82c503f7cb7b9f9d732cdfc1f818f51c8adc86d7 Mon Sep 17 00:00:00 2001 From: Michalis Kargakis Date: Wed, 18 Dec 2024 15:17:45 +0100 Subject: [PATCH] Run all benchmarks in make bench and CI --- Makefile | 3 +-- scripts/ci/benchmark-in-ci.sh | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index db52f033..80f2d55e 100644 --- a/Makefile +++ b/Makefile @@ -56,8 +56,7 @@ fmt: ## Format the code .PHONY: bench bench: ## Run benchmarks - cargo bench --features "$(FEATURES)" --bench bench_main -# cargo bench --bench bench_main -- --verbose + cargo bench --features "$(FEATURES)" --workspace .PHONY: bench-report-open bench-report-open: ## Open last benchmark report in the browser diff --git a/scripts/ci/benchmark-in-ci.sh b/scripts/ci/benchmark-in-ci.sh index cfd8392f..4abf94dc 100755 --- a/scripts/ci/benchmark-in-ci.sh +++ b/scripts/ci/benchmark-in-ci.sh @@ -50,7 +50,7 @@ function run_benchmark() { if [ "$HEAD_SHA" == "$BASE_SHA" ]; then # Benchmark only current commit, no comparison echo "Running cargo bench ..." - cargo bench --bench bench_main + cargo bench --workspace else # Benchmark target commit first, and then benchmark current commit against that baseline echo "Benchmarking ${HEAD_SHA_SHORT} against the target ${BASE_SHA_SHORT} ..." @@ -58,12 +58,12 @@ function run_benchmark() { # Switch to target commit and run benchmarks echo "Switching to $BASE_SHA_SHORT and starting benchmarks ..." git checkout $BASE_SHA - cargo bench --bench bench_main + cargo bench --workspace # Switch back to current commit and run benchmarks again echo "Switching back to $HEAD_SHA_SHORT and running benchmarks ..." git checkout $HEAD_SHA - cargo bench --bench bench_main + cargo bench --workspace fi }