Core benchmarking code.
- class Benchmarkable a where
- data Benchmark
- data Pure
- nf :: NFData b => (a -> b) -> a -> Pure
- whnf :: (a -> b) -> a -> Pure
- nfIO :: NFData a => IO a -> IO ()
- whnfIO :: IO a -> IO ()
- bench :: Benchmarkable b => String -> b -> Benchmark
- bcompare :: [Benchmark] -> Benchmark
- bgroup :: String -> [Benchmark] -> Benchmark
- runBenchmark :: Benchmarkable b => Environment -> b -> Criterion Sample
- runAndAnalyse :: (String -> Bool) -> Environment -> Benchmark -> Criterion ()
- runNotAnalyse :: (String -> Bool) -> Benchmark -> Criterion ()
A benchmarkable function or action.
Run a function or action the specified number of times.
A container for a pure function to benchmark, and an argument to supply to it each time it is evaluated.
Apply an argument to a function, and evaluate the result to head normal form (NF).
Apply an argument to a function, and evaluate the result to weak head normal form (WHNF).
Perform an action, then evaluate its result to head normal form. This is particularly useful for forcing a lazy IO action to be completely performed.
Perform an action, then evaluate its result to weak head normal form (WHNF). This is useful for forcing an IO action whose result is an expression to be evaluated down to a more useful value.
Create a single benchmark.
Compare benchmarks against a reference benchmark
bench in the given list).
The results of the comparisons are written to a CSV file specified using the
-r command line flag. The CSV file uses the following format:
Reference,Name,% faster than the reference
A name to identify the group of benchmarks.
Benchmarks to group under this name.
Group several benchmarks together under a common name.
Run a single benchmark, and return timings measured when executing it.
|:: (String -> Bool)|
A predicate that chooses whether to run a benchmark by its name.
|-> Criterion ()|
Run, and analyse, one or more benchmarks.