Expand description
Simple benchmarking functionality for supporting thyme.
Benchmarks consist of a moving average and associated statistics of a given
set of timings. Timings that are grouped together share the same tag.
You can pass a block to be timed using run
, or create a handle with
start
and end the timing with end
.
Use stats
to get a Stats
, which is the
primary interface for reporting on the timings.
Structs
- Statistics associated with a given set of benchmark timings. These are obtained with the
stats
method for a given tag. Statistics are for a moving average of the last N timings for the tag, where N is currently hardcoded to 30.
Functions
- A convenience method to automatically generate a report String for the given
tag
. The report will include all of the data in theStats
associated with thistag
, and be formatted with appropriate units. Limits to a number of recent samples if there are a large number of total samples. - Like
report
, but there is no limit on the number of samples to be considered. - Runs the specified closure
block
as a benchmark timing with the giventag
. - Like
report
, but produces a condensed version of the data. - Returns a
Stats
object for the benchmark timings associated with the giventag
. Limits to a number of recent samples if there are a large number of total samples. - Like
stats
, but there is no limit on the number of samples to be considered.