Benchee v1.0.1 Benchee.Benchmark View Source

Functions related to building and running benchmarking scenarios. Exposes benchmark/4 and collect/3 functions.

Link to this section Summary

Functions

Takes the current suite and adds a new benchmarking scenario (represented by a %Scenario{} struct) with the given name and function to the suite's scenarios. If there are inputs in the suite's config, a scenario will be added for the given function for each input

Kicks off the benchmarking of all scenarios defined in the given suite

Public access for the special key representing no input for a scenario

Link to this section Functions

Link to this function

benchmark(suite, job_name, function, printer \\ Printer) View Source
benchmark(Benchee.Suite.t(), Benchee.Suite.key(), (... -> any()), module()) ::
  Benchee.Suite.t()

Takes the current suite and adds a new benchmarking scenario (represented by a %Scenario{} struct) with the given name and function to the suite's scenarios. If there are inputs in the suite's config, a scenario will be added for the given function for each input.

Link to this function

collect(suite, printer \\ Printer, runner \\ Runner) View Source

Kicks off the benchmarking of all scenarios defined in the given suite.

Hence, this might take a while ;) Passes a list of scenarios and a scenario context to our benchmark runner. For more information on how benchmarks are actually run, see the Benchee.Benchmark.Runner code (API considered private).

Public access for the special key representing no input for a scenario.