Skip to content

Commit

Permalink
fix >5s quick mode crash, resolve bheisler#658
Browse files Browse the repository at this point in the history
When using quick mode without "--noplot", any benchmark running over 5 seconds will lead to a crash.
This commit fixes this problem by adding a very small amount (that will not be reported due to rounding) in order to work around the gnuplot crash.
See <bheisler#658>.
  • Loading branch information
KonradHoeffner committed May 25, 2023
1 parent 4a560cb commit d867451
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub(crate) trait Routine<M: Measurement, T: ?Sized> {
// Early exit for extremely long running benchmarks:
if time_start.elapsed() > maximum_bench_duration {
let iters = vec![n as f64, n as f64].into_boxed_slice();
let elapsed = vec![t_prev, t_prev].into_boxed_slice();
// prevent gnuplot bug when all values are equal
let elapsed = vec![t_prev, t_prev + 0.000001].into_boxed_slice();
return (ActualSamplingMode::Flat, iters, elapsed);
}

Expand Down

0 comments on commit d867451

Please sign in to comment.