criterion-0.1.4: Robust, reliable performance measurement and analysisSource codeContentsIndex
Criterion.Types
PortabilityGHC
Stabilityexperimental
Maintainerbos@serpentine.com
Description

Types for benchmarking.

The core class is Benchmarkable, which admits both pure functions and IO actions.

For a pure function of type Int -> a, the benchmarking harness calls this function repeatedly, each time with a different Int argument, and reduces the result the function returns to weak head normal form. If you need the result reduced to normal form, that is your responsibility.

For an action of type IO a, the benchmarking harness calls the action repeatedly, but does not reduce the result.

Synopsis
class Benchmarkable b where
run :: b -> Int -> IO ()
data Benchmark where
Benchmark :: Benchmarkable b => String -> b -> Benchmark
BenchGroup :: String -> [Benchmark] -> Benchmark
bench :: Benchmarkable b => String -> b -> Benchmark
bgroup :: String -> [Benchmark] -> Benchmark
benchNames :: Benchmark -> [String]
Documentation
class Benchmarkable b whereSource
A benchmarkable function or action.
Methods
run :: b -> Int -> IO ()Source
show/hide Instances
data Benchmark whereSource
A benchmark may consist of either a single Benchmarkable item with a name, created with bench, or a (possibly nested) group of Benchmarks, created with bgroup.
Constructors
Benchmark :: Benchmarkable b => String -> b -> Benchmark
BenchGroup :: String -> [Benchmark] -> Benchmark
show/hide Instances
benchSource
:: Benchmarkable b
=> String
-> b
-> Benchmark
Create a single benchmark.
bgroupSource
:: StringA name to identify the group of benchmarks.
-> [Benchmark]Benchmarks to group under this name.
-> Benchmark
Group several benchmarks together under a common name.
benchNames :: Benchmark -> [String]Source
Retrieve the names of all benchmarks. Grouped benchmarks are prefixed with the name of the group they're in.
Produced by Haddock version 2.6.0