Struct tiny_bench::BenchmarkConfig

source ·
pub struct BenchmarkConfig {
    pub measurement_time: Duration,
    pub num_resamples: usize,
    pub num_samples: usize,
    pub warm_up_time: Duration,
    pub dump_results_to_disk: bool,
    pub max_iterations: Option<u64>,
}
Expand description

Struct containing all of the configuration options for a benchmark.

Fields§

§measurement_time: Duration

How long the bench ‘should’ run, num_samples is prioritized so benching will take longer to be able to collect num_samples if the code to be benched is slower than this time limit allowed.

§num_resamples: usize

How many resamples should be done

§num_samples: usize

Recommended at least 50, above 100 https://en.wikipedia.org/wiki/Bootstrapping_(statistics)#Recommendations doesn’t seem to yield a significantly different result

§warm_up_time: Duration

How long the bench should warm up

§dump_results_to_disk: bool

Puts results in target/tiny-bench/label/.. if target can be found. used for comparing previous runs

§max_iterations: Option<u64>

Sets a hard ceiling on max iterations, overriding the heuristic calculations for iteration count. A rule of thumb; if this is used, the results are unlikely to be statistically significant.

Trait Implementations§

source§

impl Default for BenchmarkConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.