From 394f839e739e958bda967c10ea45b2f305cddac5 Mon Sep 17 00:00:00 2001 From: shaharsamocha7 <70577611+shaharsamocha7@users.noreply.github.com> Date: Sun, 2 Feb 2025 10:39:12 +0200 Subject: [PATCH] Change yaml bench output format (#994) * Change yaml bench output format * chore: fix bench * chore: use cargo-criterion --------- Co-authored-by: alon.dotan --- .github/workflows/ci.yaml | 12 ++++++++---- scripts/bench.sh | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d2bb45fa..69accc877 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -118,12 +118,14 @@ jobs: with: toolchain: nightly-2025-01-02 - name: Run benchmark - run: ./scripts/bench.sh -- --output-format bencher | tee output.txt + run: | + cargo install cargo-criterion + ./scripts/bench.sh |& tee output.txt - name: Download previous benchmark data uses: actions/cache@v4 with: path: ./cache - key: ${{ runner.os }}-${{github.event.pull_request.base.ref}}-benchmark + key: ${{ runner.os }}-benchmark - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: @@ -144,12 +146,14 @@ jobs: with: toolchain: nightly-2025-01-02 - name: Run benchmark - run: ./scripts/bench.sh --features="parallel" -- --output-format bencher | tee output.txt + run: | + cargo install cargo-criterion + ./scripts/bench.sh --features="parallel" |& tee output.txt - name: Download previous benchmark data uses: actions/cache@v4 with: path: ./cache - key: ${{ runner.os }}-${{github.event.pull_request.base.ref}}-benchmark + key: ${{ runner.os }}-benchmark - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: diff --git a/scripts/bench.sh b/scripts/bench.sh index 416cfb36d..1199e2c80 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 target-feature=+avx512f -C opt-level=3" cargo bench $@ +RUSTFLAGS="-Awarnings -C target-cpu=native -C opt-level=3" cargo criterion --output-format bencher $@