Skip to content

Commit

Permalink
fix >5s quick mode crash, resolve #658 (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner authored May 26, 2023
1 parent 4a560cb commit bfc84ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- Quick mode (--quick) no longer crashes with measured times over 5 seconds when --noplot is not active

## [0.5.0] - 2023-05-23

### Changed
Expand Down
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 bfc84ad

Please sign in to comment.