Safe Haskell | None |
---|---|
Language | Haskell2010 |
Run a hierarchical benchmark suite, collecting results.
- runBenchmark :: (BenchmarkId -> Maybe SamplingStrategy) -> Benchmark -> IO (HashMap BenchmarkId Sample)
- shuffle :: RandomGen g => g -> [a] -> [a]
- reorder :: RandomGen g => (g -> [Benchmark] -> [Benchmark]) -> g -> [Benchmark] -> [Benchmark]
- filtered :: (BenchmarkId -> Bool) -> SamplingStrategy -> BenchmarkId -> Maybe SamplingStrategy
- uniform :: SamplingStrategy -> BenchmarkId -> Maybe SamplingStrategy
- newtype SamplingStrategy = SamplingStrategy (Batch () -> IO Sample)
- defaultStrategy :: SamplingStrategy
- fixed :: Int64 -> SamplingStrategy
- sample :: Int64 -> SamplingStrategy -> SamplingStrategy
- geometric :: Int64 -> Int64 -> Double -> SamplingStrategy
- timeBound :: TimeSpec -> [Int64] -> SamplingStrategy
- geometricSeries :: Double -> Int64 -> [Int64]
Run benchmarks
:: (BenchmarkId -> Maybe SamplingStrategy) | Name indexed batch sampling strategy. |
-> Benchmark | Benchmark to be run. |
-> IO (HashMap BenchmarkId Sample) |
Provided a sampling strategy (which can be keyed on the BenchmarkId
),
sample the runtime of all the benchmark cases in the given benchmark tree.
Benchmark transformations
reorder :: RandomGen g => (g -> [Benchmark] -> [Benchmark]) -> g -> [Benchmark] -> [Benchmark] Source #
Sampling strategy selectors
filtered :: (BenchmarkId -> Bool) -> SamplingStrategy -> BenchmarkId -> Maybe SamplingStrategy Source #
Sampling strategies that filters the benchmarks based on a predicate: a
benchmark is included iff the predicate is True
.
uniform :: SamplingStrategy -> BenchmarkId -> Maybe SamplingStrategy Source #
Sampling strategies that ignore the name index, i.e. are uniform across all benchmarks.
Sampling strategies
defaultStrategy :: SamplingStrategy Source #
Default to 100 samples, for each batch size from 1 to 20 with a geometric progression of 1.2.
fixed :: Int64 -> SamplingStrategy Source #
Sample once a batch of fixed size.
sample :: Int64 -> SamplingStrategy -> SamplingStrategy Source #
Run a sampling strategy n
times.
:: Int64 | Sample size. |
-> Int64 | Max batch size. |
-> Double | Ratio of geometric progression. |
-> SamplingStrategy |
Batching strategy, following a geometric progression from 1 to the provided limit, with the given ratio.
:: TimeSpec | Time bound |
-> [Int64] | Sample sizes; may be infinite |
-> SamplingStrategy |
Sampling strategy that creates samples of the specified sizes with a time bound. Sampling stops when either a sample has been sampled for each size or when the total benchmark time is greater than the specified time bound.
The actual amount of time spent may be longer since hyperion will always
wait for a Sample
of a given size to complete.