pub struct Bench {
pub config: BenchConfig,
pub groups: Vec<(Vec<(String, Box<dyn Register<Box<dyn Arg>>>)>, (TypeId, Vec<Box<dyn Arg>>))>,
}
Expand description
main benchmark entry point, used to register functions and arguments, then run benchmarks.
Fields§
§config: BenchConfig
§groups: Vec<(Vec<(String, Box<dyn Register<Box<dyn Arg>>>)>, (TypeId, Vec<Box<dyn Arg>>))>
Implementations§
source§impl Bench
impl Bench
sourcepub fn new(config: impl AsRef<BenchConfig>) -> Self
pub fn new(config: impl AsRef<BenchConfig>) -> Self
create a bench object from the given configuration.
sourcepub fn register_many<T: Arg>(
&mut self,
f: impl RegisterMany<T>,
args: impl IntoIterator<Item = T>
)
pub fn register_many<T: Arg>( &mut self, f: impl RegisterMany<T>, args: impl IntoIterator<Item = T> )
register multiple functions that should be compared against each other during benchmarking, all taking the same arguments.
sourcepub fn register<T: Arg>(
&mut self,
f: impl Register<T>,
args: impl IntoIterator<Item = T>
)
pub fn register<T: Arg>( &mut self, f: impl Register<T>, args: impl IntoIterator<Item = T> )
register a function for benchmarking, and the arguments that should be passed to it.
sourcepub fn run(&mut self) -> Result<BenchResult>
pub fn run(&mut self) -> Result<BenchResult>
run the benchmark, and write the results to stdout, and optionally to a file, depending on the configuration options.
Auto Trait Implementations§
impl Freeze for Bench
impl !RefUnwindSafe for Bench
impl !Send for Bench
impl !Sync for Bench
impl Unpin for Bench
impl !UnwindSafe for Bench
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
Mutably borrows from an owned value. Read more