Copyright | (c) 2009-2014 Bryan O'Sullivan |
---|---|
License | BSD-style |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Criterion.Types
Description
Types for benchmarking.
The core type is Benchmarkable
, which admits both pure functions
and IO
actions.
For a pure function of type a -> b
, the benchmarking harness
calls this function repeatedly, each time with a different Int64
argument (the number of times to run the function in a loop), and
reduces the result the function returns to weak head normal form.
For an action of type IO a
, the benchmarking harness calls the
action repeatedly, but does not reduce the result.
Synopsis
- data Config = Config {}
- data Verbosity
- data Benchmarkable = NFData a => Benchmarkable {}
- data Benchmark where
- Environment :: forall env a. NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
- Benchmark :: String -> Benchmarkable -> Benchmark
- BenchGroup :: String -> [Benchmark] -> Benchmark
- data Measured = Measured {
- measTime :: !Double
- measCpuTime :: !Double
- measCycles :: !Int64
- measIters :: !Int64
- measAllocated :: !Int64
- measPeakMbAllocated :: !Int64
- measNumGcs :: !Int64
- measBytesCopied :: !Int64
- measMutatorWallSeconds :: !Double
- measMutatorCpuSeconds :: !Double
- measGcWallSeconds :: !Double
- measGcCpuSeconds :: !Double
- fromInt :: Int64 -> Maybe Int64
- toInt :: Maybe Int64 -> Int64
- fromDouble :: Double -> Maybe Double
- toDouble :: Maybe Double -> Double
- measureAccessors :: Map String (Measured -> Maybe Double, String)
- measureKeys :: [String]
- measure :: Unbox a => (Measured -> a) -> Vector Measured -> Vector a
- rescale :: Measured -> Measured
- env :: NFData env => IO env -> (env -> Benchmark) -> Benchmark
- envWithCleanup :: NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
- perBatchEnv :: (NFData env, NFData b) => (Int64 -> IO env) -> (env -> IO b) -> Benchmarkable
- perBatchEnvWithCleanup :: (NFData env, NFData b) => (Int64 -> IO env) -> (Int64 -> env -> IO ()) -> (env -> IO b) -> Benchmarkable
- perRunEnv :: (NFData env, NFData b) => IO env -> (env -> IO b) -> Benchmarkable
- perRunEnvWithCleanup :: (NFData env, NFData b) => IO env -> (env -> IO ()) -> (env -> IO b) -> Benchmarkable
- toBenchmarkable :: (Int64 -> IO ()) -> Benchmarkable
- bench :: String -> Benchmarkable -> Benchmark
- bgroup :: String -> [Benchmark] -> Benchmark
- addPrefix :: String -> String -> String
- benchNames :: Benchmark -> [String]
- nf :: NFData b => (a -> b) -> a -> Benchmarkable
- whnf :: (a -> b) -> a -> Benchmarkable
- nfIO :: NFData a => IO a -> Benchmarkable
- whnfIO :: IO a -> Benchmarkable
- nfAppIO :: NFData b => (a -> IO b) -> a -> Benchmarkable
- whnfAppIO :: (a -> IO b) -> a -> Benchmarkable
- data Outliers = Outliers {
- samplesSeen :: !Int64
- lowSevere :: !Int64
- lowMild :: !Int64
- highMild :: !Int64
- highSevere :: !Int64
- data OutlierEffect
- = Unaffected
- | Slight
- | Moderate
- | Severe
- data OutlierVariance = OutlierVariance {}
- data Regression = Regression {
- regResponder :: String
- regCoeffs :: Map String (Estimate ConfInt Double)
- regRSquare :: Estimate ConfInt Double
- data KDE = KDE {}
- data Report = Report {}
- data SampleAnalysis = SampleAnalysis {
- anRegress :: [Regression]
- anMean :: Estimate ConfInt Double
- anStdDev :: Estimate ConfInt Double
- anOutlierVar :: OutlierVariance
- data DataRecord
Configuration
Top-level benchmarking configuration.
Constructors
Config | |
Fields
|
Instances
Control the amount of information displayed.
Instances
Benchmark descriptions
data Benchmarkable #
Constructors
Environment :: forall env a. NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark | |
Benchmark :: String -> Benchmarkable -> Benchmark | |
BenchGroup :: String -> [Benchmark] -> Benchmark |
Measurements
Constructors
Measured | |
Fields
|
Instances
fromDouble :: Double -> Maybe Double #
measureKeys :: [String] #
Benchmark construction
perBatchEnv :: (NFData env, NFData b) => (Int64 -> IO env) -> (env -> IO b) -> Benchmarkable #
perBatchEnvWithCleanup :: (NFData env, NFData b) => (Int64 -> IO env) -> (Int64 -> env -> IO ()) -> (env -> IO b) -> Benchmarkable #
perRunEnvWithCleanup :: (NFData env, NFData b) => IO env -> (env -> IO ()) -> (env -> IO b) -> Benchmarkable #
toBenchmarkable :: (Int64 -> IO ()) -> Benchmarkable #
bench :: String -> Benchmarkable -> Benchmark #
benchNames :: Benchmark -> [String] #
Evaluation control
nf :: NFData b => (a -> b) -> a -> Benchmarkable #
whnf :: (a -> b) -> a -> Benchmarkable #
nfIO :: NFData a => IO a -> Benchmarkable #
whnfIO :: IO a -> Benchmarkable #
nfAppIO :: NFData b => (a -> IO b) -> a -> Benchmarkable #
whnfAppIO :: (a -> IO b) -> a -> Benchmarkable #
Result types
Outliers from sample data, calculated using the boxplot technique.
Constructors
Outliers | |
Fields
|
Instances
data OutlierEffect Source #
A description of the extent to which outliers in the sample data affect the sample mean and standard deviation.
Constructors
Unaffected | Less than 1% effect. |
Slight | Between 1% and 10%. |
Moderate | Between 10% and 50%. |
Severe | Above 50% (i.e. measurements are useless). |
Instances
data OutlierVariance Source #
Analysis of the extent to which outliers in a sample affect its standard deviation (and to some extent, its mean).
Constructors
OutlierVariance | |
Fields
|
Instances
data Regression Source #
Results of a linear regression.
Constructors
Regression | |
Fields
|
Instances
Data for a KDE chart of performance.
Instances
FromJSON KDE Source # | |
ToJSON KDE Source # | |
Data KDE Source # | |
Defined in Criterion.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KDE -> c KDE Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KDE Source # toConstr :: KDE -> Constr Source # dataTypeOf :: KDE -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KDE) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KDE) Source # gmapT :: (forall b. Data b => b -> b) -> KDE -> KDE Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KDE -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KDE -> r Source # gmapQ :: (forall d. Data d => d -> u) -> KDE -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> KDE -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KDE -> m KDE Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KDE -> m KDE Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KDE -> m KDE Source # | |
Generic KDE Source # | |
Read KDE Source # | |
Show KDE Source # | |
Binary KDE Source # | |
NFData KDE Source # | |
Defined in Criterion.Types | |
Eq KDE Source # | |
type Rep KDE Source # | |
Defined in Criterion.Types type Rep KDE = D1 ('MetaData "KDE" "Criterion.Types" "criterion-1.6.1.0-1qrwpjmgoZTK27WOgYXsGc" 'False) (C1 ('MetaCons "KDE" 'PrefixI 'True) (S1 ('MetaSel ('Just "kdeType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "kdeValues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Double)) :*: S1 ('MetaSel ('Just "kdePDF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Double))))) |
Report of a sample analysis.
Constructors
Report | |
Fields
|
Instances
data SampleAnalysis Source #
Result of a bootstrap analysis of a non-parametric sample.
Constructors
SampleAnalysis | |
Fields
|
Instances
data DataRecord Source #