From bfc84ada36a6bba71eae880f787662d4bbde6260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20H=C3=B6ffner?= Date: Fri, 26 May 2023 08:49:05 +0100 Subject: [PATCH] fix >5s quick mode crash, resolve #658 (#685) --- CHANGELOG.md | 3 +++ src/routine.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 638f1ab8..679f0778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/routine.rs b/src/routine.rs index b03b171d..88e4318b 100644 --- a/src/routine.rs +++ b/src/routine.rs @@ -103,7 +103,8 @@ pub(crate) trait Routine { // 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); }