criterion-1.1.4.0: Robust, reliable performance measurement and analysis

Copyright (c) 2009-2014 Bryan O'Sullivan BSD-style bos@serpentine.com experimental GHC Trustworthy Haskell98

Criterion.Measurement

Description

Benchmark measurement code.

Synopsis

# Documentation

Set up time measurement.

Return the current wallclock time, in seconds since some arbitrary time.

You must call initializeTime once before calling this function!

Return the amount of elapsed CPU time, combining user and kernel (system) time into a single measure.

Read the CPU cycle counter.

Try to get GC statistics, bearing in mind that the GHC runtime will throw an exception if statistics collection was not enabled using "+RTS -T".

Convert a number of seconds to a string. The string will consist of four decimal places, followed by a short description of the time units.

Arguments

 :: Benchmarkable Operation to benchmark. -> Int64 Number of iterations. -> IO (Measured, Double)

Measure the execution of a benchmark a given number of times.

Arguments

 :: Benchmarkable -> Double Lower bound on how long the benchmarking process should take. In practice, this time limit may be exceeded in order to generate enough data to perform meaningful statistical analyses. -> IO (Vector Measured, Double)

Run a single benchmark, and return measurements collected while executing it, along with the amount of time the measurement process took.

An empty structure.

Arguments

 :: Maybe GCStats Statistics gathered at the end of a run. -> Maybe GCStats Statistics gathered at the beginning of a run. -> Measured Value to "modify". -> Measured

Apply the difference between two sets of GC statistics to a measurement.

The amount of time a benchmark must run for in order for us to have some trust in the raw measurement.

We set this threshold so that we can generate enough data to later perform meaningful statistical analyses.

The threshold is 30 milliseconds. One use of runBenchmark must accumulate more than 300 milliseconds of total measurements above this threshold before it will finish.