pub struct RegressionConfig(/* private fields */);
default
only.Expand description
Configure performance regression checks and behavior
A performance regression check consists of an EventKind
and a percentage over which a
regression is assumed. If the percentage is negative, then a regression is assumed to be below
this limit. The default EventKind
is EventKind::Ir
with a value of
+10f64
If fail_fast
is set to true, then the whole benchmark run fails on the first encountered
regression. Else, the default behavior is, that the benchmark run fails with a regression error
after all benchmarks have been run.
§Examples
use iai_callgrind::{main, LibraryBenchmarkConfig, RegressionConfig};
main!(
config = LibraryBenchmarkConfig::default()
.regression(RegressionConfig::default());
library_benchmark_groups = some_group
);
Implementations§
source§impl RegressionConfig
impl RegressionConfig
Enable performance regression checks with a RegressionConfig
A performance regression check consists of an EventKind
and a percentage over which a
regression is assumed. If the percentage is negative, then a regression is assumed to be below
this limit. The default EventKind
is EventKind::Ir
with a value of
+10f64
If fail_fast
is set to true, then the whole benchmark run fails on the first encountered
regression. Else, the default behavior is, that the benchmark run fails with a regression error
after all benchmarks have been run.
§Examples
use iai_callgrind::{LibraryBenchmarkConfig, RegressionConfig};
main!(
config = LibraryBenchmarkConfig::default()
.regression(RegressionConfig::default());
library_benchmark_groups = some_group
);
sourcepub fn limits<T>(&mut self, targets: T) -> &mut Self
pub fn limits<T>(&mut self, targets: T) -> &mut Self
Configure the limits percentages over/below which a performance regression can be assumed
A performance regression check consists of an EventKind
and a percentage over which a
regression is assumed. If the percentage is negative, then a regression is assumed to be
below this limit.
If no limits
or empty targets
are specified with this function, the default
EventKind
is EventKind::Ir
with a value of +10f64
§Examples
use iai_callgrind::{EventKind, RegressionConfig};
let config = RegressionConfig::default().limits([(EventKind::Ir, 5f64)]);
sourcepub fn fail_fast(&mut self, value: bool) -> &mut Self
pub fn fail_fast(&mut self, value: bool) -> &mut Self
If set to true, then the benchmarks fail on the first encountered regression
The default is false
and the whole benchmark run fails with a regression error after all
benchmarks have been run.
§Examples
use iai_callgrind::RegressionConfig;
let config = RegressionConfig::default().fail_fast(true);
Trait Implementations§
source§impl AsRef<RegressionConfig> for RegressionConfig
impl AsRef<RegressionConfig> for RegressionConfig
source§fn as_ref(&self) -> &InternalRegressionConfig
fn as_ref(&self) -> &InternalRegressionConfig
source§impl Clone for RegressionConfig
impl Clone for RegressionConfig
source§fn clone(&self) -> RegressionConfig
fn clone(&self) -> RegressionConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RegressionConfig
impl Debug for RegressionConfig
source§impl Default for RegressionConfig
impl Default for RegressionConfig
source§fn default() -> RegressionConfig
fn default() -> RegressionConfig
source§impl From<&RegressionConfig> for InternalRegressionConfig
impl From<&RegressionConfig> for InternalRegressionConfig
source§fn from(value: &RegressionConfig) -> Self
fn from(value: &RegressionConfig) -> Self
source§impl From<&mut RegressionConfig> for InternalRegressionConfig
impl From<&mut RegressionConfig> for InternalRegressionConfig
source§fn from(value: &mut RegressionConfig) -> Self
fn from(value: &mut RegressionConfig) -> Self
source§impl From<RegressionConfig> for InternalRegressionConfig
impl From<RegressionConfig> for InternalRegressionConfig
source§fn from(value: RegressionConfig) -> Self
fn from(value: RegressionConfig) -> Self
Auto Trait Implementations§
impl Freeze for RegressionConfig
impl RefUnwindSafe for RegressionConfig
impl Send for RegressionConfig
impl Sync for RegressionConfig
impl Unpin for RegressionConfig
impl UnwindSafe for RegressionConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)