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.
This commit is contained in:
Sylvestre Ledru
2026-03-24 22:59:00 +01:00
parent 522bad3b48
commit 395cef5d78
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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
+2 -1
View File
@@ -22,4 +22,5 @@ is_prime = "2.0.7"
glass_pumpkin = "1.2.0"
[features]
default = ["num-primes"]
default = []
num-primes = ["dep:num-primes"]