From 395cef5d78e8a939f2e4a8e93b44f44a00166c46 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 24 Mar 2026 22:35:19 +0100 Subject: [PATCH] bench: exclude non-deterministic num-primes benchmarks by default num-primes uses thread_rng() internally, making its benchmarks non-deterministic and causing false regressions in CodSpeed CI. Remove num-primes from default features so it's excluded from CI benchmarks. All num-primes bench_functions are gated behind #[cfg(feature = "num-primes")] - use --features num-primes to include them for local comparison. --- .github/workflows/codspeed.yml | 2 +- bench/Cargo.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index b5beeda..d9e59bf 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -31,7 +31,7 @@ jobs: bins: cargo-codspeed - name: Build the benchmark target(s) - run: cargo codspeed build -m ${{ matrix.mode }} -p num-prime-bench --no-default-features + run: cargo codspeed build -m ${{ matrix.mode }} -p num-prime-bench - name: Run the benchmarks uses: CodSpeedHQ/action@v4 diff --git a/bench/Cargo.toml b/bench/Cargo.toml index aa0059d..0e48f68 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -22,4 +22,5 @@ is_prime = "2.0.7" glass_pumpkin = "1.2.0" [features] -default = ["num-primes"] +default = [] +num-primes = ["dep:num-primes"]