From ff7c9b4b43292eaec99aae84947e023da2fd0ac1 Mon Sep 17 00:00:00 2001 From: "alon.dotan" Date: Wed, 15 Jan 2025 14:58:08 +0200 Subject: [PATCH] chore: use cargo-criterion --- .github/workflows/ci.yaml | 8 ++------ scripts/bench.sh | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ffe4327a4..95059a21a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -119,18 +119,14 @@ jobs: toolchain: nightly-2025-01-02 - name: Run benchmark run: | - sudo apt update && sudo apt install -y gnuplot + cargo install cargo-criterion ./scripts/bench.sh | tee output.txt - pwd - ls -l cat output.txt - - name: Download previous benchmark data uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-${{github.event.pull_request.base.ref}}-benchmark - - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: @@ -152,7 +148,7 @@ jobs: toolchain: nightly-2025-01-02 - name: Run benchmark run: | - apt update && apt install -y gnuplot + cargo install cargo-criterion ./scripts/bench.sh --features="parallel" | tee output.txt - name: Download previous benchmark data uses: actions/cache@v4 diff --git a/scripts/bench.sh b/scripts/bench.sh index 0dfc6b9dc..4c9ae026c 100755 --- a/scripts/bench.sh +++ b/scripts/bench.sh @@ -2,4 +2,4 @@ # Can be used as a drop in replacement for `cargo bench`. # For example, `./scripts/bench.sh` will run all benchmarks. # or `./scripts/bench.sh M31` will run only the M31 benchmarks. -RUSTFLAGS="-Awarnings -C target-cpu=native -C opt-level=3" cargo bench $@ +RUSTFLAGS="-Awarnings -C target-cpu=native -C target-feature=+avx512f -C opt-level=3" cargo criterion --output-format bencher $@