BuildBox.Benchmark
Contents
Description
Running benchmarks and collecting timings.
These functions expect the given Build
commands to succeed,
throwing an error if they don't. If you're not sure whether your command will succeed then test it first.
- module BuildBox.Benchmark.TimeAspect
- module BuildBox.Benchmark.Pretty
- module BuildBox.Benchmark.Compare
- data Benchmark = Benchmark {}
- data Timing = Timing {}
- data BenchRunResult = BenchRunResult {}
- data BenchResult = BenchResult {}
- runTimedCommand :: Build a -> Build (NominalDiffTime, a)
- runBenchmarkOnce :: Benchmark -> Build BenchRunResult
- outRunBenchmarkOnce :: Benchmark -> Build BenchRunResult
- outRunBenchmarkAgainst :: Int -> Maybe BenchResult -> Benchmark -> Build BenchResult
- outRunBenchmarkWith :: Int -> [BenchResult] -> Benchmark -> Build BenchResult
Documentation
module BuildBox.Benchmark.Pretty
module BuildBox.Benchmark.Compare
Types
Describes a benchmark that we can run.
Constructors
Benchmark | |
Fields
|
Holds elapsed, cpu, and system timings (in seconds).
Constructors
Timing | |
data BenchRunResult Source
The result of running a benchmark once.
Constructors
BenchRunResult | |
Fields
|
Instances
data BenchResult Source
The result of running a benchmark several times. We include the name of the original benchmark to it's easy to lookup the results.
Constructors
BenchResult | |
Fields |
Instances
Benchmarking
runTimedCommand :: Build a -> Build (NominalDiffTime, a)Source
Run a command, returning its elapsed time.
runBenchmarkOnce :: Benchmark -> Build BenchRunResultSource
Run a benchmark once.
outRunBenchmarkOnce :: Benchmark -> Build BenchRunResultSource
Run a benchmark once, logging activity and timings to the console.
Arguments
:: Int | Number of iterations. |
-> Maybe BenchResult | Optional previous result for comparison. |
-> Benchmark | Benchmark to run. |
-> Build BenchResult |
Run a benchmark several times, logging activity to the console. Optionally print a comparison with a prior results.
Arguments
:: Int | Number of times to run each benchmark to get averages. |
-> [BenchResult] | List of prior results. |
-> Benchmark | The benchmark to run. |
-> Build BenchResult |
Run a benchmark serveral times, logging activity to the console. Also lookup prior results for comparison from the given list. If there is no matching entry then run the benchmark anyway, but don't print the comparison.