From 507983216ef1edebe0cff893ed3ade0e357789f5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 7 Nov 2026 17:39:22 +0200 Subject: [PATCH 1/2] ci: reduce benchmark sampling time and cache overhead --- .github/workflows/benchmark.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bf87de4..ebb5e2b 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -4,8 +4,7 @@ on: push: branches: [main] pull_request: - types: [opened, synchronize, reopened, ready_for_review] - workflow_dispatch: + types: [opened, synchronize, reopened] permissions: contents: read @@ -20,6 +19,8 @@ jobs: name: Run benchmarks runs-on: codspeed-macro-arm64-graviton-ubuntu-22-04 timeout-minutes: 10 + env: + ZSTD_CLEVEL: "1" steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -30,6 +31,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: toolchain: nightly + cache-save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install cargo-codspeed uses: taiki-e/install-action@1e29709c0ec63babbe8f266397a465f29a825f91 # v2.87.31 @@ -43,8 +45,8 @@ jobs: uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5.6.0 env: DIVAN_SAMPLE_SIZE: "10000" - DIVAN_MIN_TIME: "1" - DIVAN_MAX_TIME: "1" + DIVAN_MIN_TIME: "0.1" + DIVAN_MAX_TIME: "0.1" with: mode: walltime,memory run: cargo codspeed run From 419a32cb0d8670bc589e913b3eb572847f5ac60c Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 7 Nov 2026 17:48:56 +0200 Subject: [PATCH 2/2] ci: cache CodSpeed builds and retain ten timing samples --- .github/workflows/benchmark.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ebb5e2b..dc97b16 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,7 +31,11 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: toolchain: nightly - cache-save-if: ${{ github.ref == 'refs/heads/main' }} + cache-key: codspeed-builds + cache-workspaces: | + . -> target/codspeed/walltime + . -> target/codspeed/analysis + cache-workspace-crates: true - name: Install cargo-codspeed uses: taiki-e/install-action@1e29709c0ec63babbe8f266397a465f29a825f91 # v2.87.31 @@ -45,8 +49,9 @@ jobs: uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5.6.0 env: DIVAN_SAMPLE_SIZE: "10000" - DIVAN_MIN_TIME: "0.1" - DIVAN_MAX_TIME: "0.1" + DIVAN_SAMPLE_COUNT: "10" + DIVAN_MIN_TIME: "0" + DIVAN_MAX_TIME: "0.5" with: mode: walltime,memory run: cargo codspeed run