Struct tango_bench::MeasurementSettings
source · pub struct MeasurementSettings {
pub filter_outliers: bool,
pub samples_per_haystack: usize,
pub min_iterations_per_sample: usize,
pub max_iterations_per_sample: usize,
pub sampler_type: SampleLengthKind,
pub warmup_enabled: bool,
pub cache_firewall: Option<usize>,
pub yield_before_sample: bool,
pub randomize_stack: Option<usize>,
}
Expand description
Describes basic settings for the benchmarking process
This structure is passed to cli::run()
.
Should be created only with overriding needed properties, like so:
use tango_bench::MeasurementSettings;
let settings = MeasurementSettings {
min_iterations_per_sample: 1000,
..Default::default()
};
Fields§
§filter_outliers: bool
§samples_per_haystack: usize
The number of samples per one generated haystack
min_iterations_per_sample: usize
Minimum number of iterations in a sample for each of 2 tested functions
max_iterations_per_sample: usize
The number of iterations in a sample for each of 2 tested functions
sampler_type: SampleLengthKind
§warmup_enabled: bool
If true scheduler performs warmup iterations before measuring function
cache_firewall: Option<usize>
Size of a CPU cache firewall in KBytes
If set, the scheduler will perform a dummy data read between samples generation to spoil the CPU cache
Cache firewall is a way to reduce the impact of the CPU cache on the benchmarking process. It tries to minimize discrepancies in performance between two algorithms due to the CPU cache state.
yield_before_sample: bool
If true, scheduler will perform a yield of control back to the OS before taking each sample
Yielding control to the OS is a way to reduce the impact of OS scheduler on the benchmarking process.
randomize_stack: Option<usize>
If set, use alloca to allocate a random offset for the stack each sample. This to reduce memory alignment effects on the benchmarking process.
May cause UB if the allocation is larger then the thread stack size.
Trait Implementations§
source§impl Clone for MeasurementSettings
impl Clone for MeasurementSettings
source§fn clone(&self) -> MeasurementSettings
fn clone(&self) -> MeasurementSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MeasurementSettings
impl Debug for MeasurementSettings
source§impl Default for MeasurementSettings
impl Default for MeasurementSettings
impl Copy for MeasurementSettings
Auto Trait Implementations§
impl Freeze for MeasurementSettings
impl RefUnwindSafe for MeasurementSettings
impl Send for MeasurementSettings
impl Sync for MeasurementSettings
impl Unpin for MeasurementSettings
impl UnwindSafe for MeasurementSettings
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
)source§impl<T> Colorize for Twhere
T: ?Sized,
impl<T> Colorize for Twhere
T: ?Sized,
source§fn into_style(self) -> StyledValue<Self>where
Self: Sized,
fn into_style(self) -> StyledValue<Self>where
Self: Sized,
StyledValue
source§fn style(&self) -> StyledValue<&Self>
fn style(&self) -> StyledValue<&Self>
StyledValue
source§fn into_style_with<F, B, U>(
self,
style: Style<F, B, U>,
) -> StyledValue<Self, F, B, U>where
Self: Sized,
fn into_style_with<F, B, U>(
self,
style: Style<F, B, U>,
) -> StyledValue<Self, F, B, U>where
Self: Sized,
StyledValue
and applies the given stylesource§fn style_with<F, B, U>(
&self,
style: Style<F, B, U>,
) -> StyledValue<&Self, F, B, U>
fn style_with<F, B, U>( &self, style: Style<F, B, U>, ) -> StyledValue<&Self, F, B, U>
StyledValue
and applies the given style