Skip to content

Commit 73868b0

Browse files
committed
perf(bench): reduce sample_size from 10 to 3 for Corpus/Entropy/Large/Silesia
Criterion warned 'Unable to complete 10 samples in 4.0s' on heavy levels (level_22_btultra2 + 1 MiB+ payloads) because a single encode pass already takes well over a second. Drop sample_size to 3 for the three scenario classes that fired the warning. Three samples + the existing measurement_time budget is enough for the dashboard's regression-band sensitivity (±5%) on canonical alert levels while keeping per-shard wall time bounded. Small scenarios stay at sample_size=30 (they finish in microseconds, more samples cheap).
1 parent b6336ec commit 73868b0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

zstd/benches/compare_ffi.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,22 @@ fn configure_group<M: criterion::measurement::Measurement>(
510510
group.sampling_mode(SamplingMode::Flat);
511511
}
512512
ScenarioClass::Corpus | ScenarioClass::Entropy => {
513-
group.sample_size(10);
513+
// 3 samples (was 10) — at level_22_btultra2 a single encode
514+
// pass on `decodecorpus-z000033` (~1 MiB) takes well over
515+
// 1s, so criterion would otherwise warn "Unable to complete
516+
// 10 samples in 4s, increase target time to 5.2s". Three
517+
// samples are enough for the dashboard's regression-band
518+
// ±5% sensitivity while keeping per-shard wall time bounded.
519+
group.sample_size(3);
514520
group.measurement_time(Duration::from_secs(4));
515521
group.sampling_mode(SamplingMode::Flat);
516522
}
517523
ScenarioClass::Large | ScenarioClass::Silesia => {
518-
group.sample_size(10);
524+
// 3 samples (was 10) — Large/Silesia payloads (~16-100 MiB)
525+
// dominate per-shard runtime at higher levels. Three
526+
// samples + 2s measurement is sufficient for regression
527+
// detection on the canonical alert levels.
528+
group.sample_size(3);
519529
group.measurement_time(Duration::from_secs(2));
520530
group.warm_up_time(Duration::from_millis(500));
521531
group.sampling_mode(SamplingMode::Flat);

0 commit comments

Comments
 (0)