Skip to content

Commit 395cef5

Browse files
committed
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.
1 parent 522bad3 commit 395cef5

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/codspeed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
bins: cargo-codspeed
3232

3333
- name: Build the benchmark target(s)
34-
run: cargo codspeed build -m ${{ matrix.mode }} -p num-prime-bench --no-default-features
34+
run: cargo codspeed build -m ${{ matrix.mode }} -p num-prime-bench
3535

3636
- name: Run the benchmarks
3737
uses: CodSpeedHQ/action@v4

bench/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ is_prime = "2.0.7"
2222
glass_pumpkin = "1.2.0"
2323

2424
[features]
25-
default = ["num-primes"]
25+
default = []
26+
num-primes = ["dep:num-primes"]

0 commit comments

Comments
 (0)