uBench
Loading...
Searching...
No Matches
ubench::benchmark Class Reference

Public Member Functions

 benchmark (options *options)
 
 benchmark (const std::string &name, target_fn target)
 
benchmark prepare (const prepare_fn fn) const
 
benchmark iteration (const size_t iteration) const
 
benchmark step (const size_t step) const
 
benchmark warmup (const bool light) const
 
duration operator() (arg arg, size_t iter) const
 
entry operator() (arg arg) const
 
void warm_up (arg arg) const
 
void operator() (std::vector< entry > &entries) const
 

Member Function Documentation

◆ iteration()

benchmark ubench::benchmark::iteration ( const size_t iteration) const
inline

Sets iteration count.

Parameters
iterationIteration count to use
Returns
Changed benchmark object

◆ operator()() [1/3]

entry ubench::benchmark::operator() ( arg arg) const
nodiscard

Runs operation with given argument.

Parameters
argArgument to be passed
Returns
Benchmark result entry

◆ operator()() [2/3]

duration ubench::benchmark::operator() ( arg arg,
size_t iter ) const
nodiscard

Runs operation with given argument and iteration count.

Parameters
argArgument to be passed
iterIteration count
Returns
Elapsed time per operation

◆ operator()() [3/3]

void ubench::benchmark::operator() ( std::vector< entry > & entries) const

Runs whole benchmark.

Parameters
entriesEntry vector to store results

◆ prepare()

benchmark ubench::benchmark::prepare ( const prepare_fn fn) const
inline

Register a routine as preparing routine.

Parameters
fnPreparing routine to register
Returns
Changed benchmark object

◆ step()

benchmark ubench::benchmark::step ( const size_t step) const
inline

Sets step count for iteration.

Parameters
stepStep count to use
Returns
Changed benchmark object

◆ warm_up()

void ubench::benchmark::warm_up ( arg arg) const

Warms up this benchmark.

Parameters
argArgument to be passed

◆ warmup()

benchmark ubench::benchmark::warmup ( const bool light) const
inline

Set whether that warm-up should be light

  • Light : Just iterates constant times
  • Heavy : Reducing fluctuation of the coefficient of variation below the threshold (10%)

The documentation for this class was generated from the following file: