shake-bench-0.2.0.0: Build rules for historical benchmarking
Safe HaskellSafe-Inferred
LanguageHaskell2010

Development.Benchmark.Rules

Description

This module provides a bunch of Shake rules to build multiple revisions of a project and analyse their performance.

It assumes a project bench suite composed of examples that runs a fixed set of experiments on every example

Your code must implement all of the GetFoo oracles and the IsExample class, instantiate the Shake rules, and probably want a set of targets.

The results of the benchmarks and the analysis are recorded in the file system, using the following structure:

build-folder ├── binaries │ └── git-reference │  ├── ghc.path - path to ghc used to build the executable │  ├── executable - binary for this version │  └── commitid - Git commit id for this reference ├─ example │ ├── results.csv - aggregated results for all the versions and configurations │ ├── experiment.svg - graph of bytes over elapsed time, for all the versions and configurations | └── git-reference │ └── configuration │   ├── experiment.gcStats.log - RTS -s output │   ├── experiment.csv - stats for the experiment │   ├── experiment.svg - Graph of bytes over elapsed time │   ├── experiment.diff.svg - idem, including the previous version │   ├── experiment.heap.svg - Heap profile │   ├── experiment.log - bench stdout │   └── results.csv - results of all the experiments for the example ├── results.csv - aggregated results of all the examples, experiments, versions and configurations └── experiment.svg - graph of bytes over elapsed time, for all the examples, experiments, versions and configurations

For diff graphs, the "previous version" is the preceding entry in the list of versions in the config file. A possible improvement is to obtain this info via `git rev-list`.

Synopsis

Documentation

buildRules :: FilePattern -> MkBuildRules BuildSystem -> Rules () Source #

Rules that drive a build system to build various revisions of a project

data MkBuildRules buildSystem Source #

Constructors

MkBuildRules 

Fields

data MkBenchRules buildSystem example Source #

Constructors

forall setup. MkBenchRules 

Fields

data BenchProject example Source #

Constructors

BenchProject 

Fields

data ProfilingMode Source #

Instances

Instances details
Eq ProfilingMode Source # 
Instance details

Defined in Development.Benchmark.Rules

csvRules :: forall example. RuleResultForExample example => FilePattern -> Rules () Source #

Rules to aggregate the CSV output of individual experiments

svgRules :: FilePattern -> Rules () Source #

Rules to produce charts for the GC stats

phonyRules Source #

Arguments

:: (Traversable t, IsExample e) 
=> String

prefix

-> String

Executable name

-> ProfilingMode 
-> FilePath 
-> t e 
-> Rules () 

Generate a set of phony rules: * prefixall * prefixexample for each example

newtype GetExample Source #

Constructors

GetExample String 

Instances

Instances details
Show GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: GetExample -> () #

Eq GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

newtype GetExamples Source #

Constructors

GetExamples () 

Instances

Instances details
Show GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: GetExamples -> () #

Eq GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

class (Binary e, Eq e, Hashable e, NFData e, Show e, Typeable e) => IsExample e where Source #

Knowledge needed to run an example

Methods

getExampleName :: e -> String Source #

newtype GetVersions Source #

Constructors

GetVersions () 

Instances

Instances details
Show GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: GetVersions -> () #

Eq GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

type RuleResult GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

newtype GetCommitId Source #

Constructors

GetCommitId String 

Instances

Instances details
Show GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: GetCommitId -> () #

Eq GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

type RuleResult GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

data Configuration Source #

Constructors

Configuration 

Instances

Instances details
Generic Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

Associated Types

type Rep Configuration :: Type -> Type #

Show Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: Configuration -> () #

Eq Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep Configuration Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep Configuration = D1 ('MetaData "Configuration" "Development.Benchmark.Rules" "shake-bench-0.2.0.0-GBfwpyOoQh65kxC6vx003f" 'False) (C1 ('MetaCons "Configuration" 'PrefixI 'True) (S1 ('MetaSel ('Just "confName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "confValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

data BuildSystem Source #

Default build system that handles Cabal and Stack

Constructors

Cabal 
Stack 

Instances

Instances details
FromJSON BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

ToJSON BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Generic BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Associated Types

type Rep BuildSystem :: Type -> Type #

Read BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Show BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: BuildSystem -> () #

Eq BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep BuildSystem = D1 ('MetaData "BuildSystem" "Development.Benchmark.Rules" "shake-bench-0.2.0.0-GBfwpyOoQh65kxC6vx003f" 'False) (C1 ('MetaCons "Cabal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Stack" 'PrefixI 'False) (U1 :: Type -> Type))

newtype Escaped a Source #

Constructors

Escaped 

Fields

newtype Unescaped a Source #

Constructors

Unescaped 

Fields

Instances

Instances details
FromJSON a => FromJSON (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

ToJSON a => ToJSON (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Show a => Show (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary a => Binary (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

put :: Unescaped a -> Put #

get :: Get (Unescaped a) #

putList :: [Unescaped a] -> Put #

NFData a => NFData (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: Unescaped a -> () #

Eq a => Eq (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

(==) :: Unescaped a -> Unescaped a -> Bool #

(/=) :: Unescaped a -> Unescaped a -> Bool #

Hashable a => Hashable (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

hashWithSalt :: Int -> Unescaped a -> Int #

hash :: Unescaped a -> Int #

data GitCommit Source #

Instances

Instances details
FromJSON GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

ToJSON GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Generic GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Associated Types

type Rep GitCommit :: Type -> Type #

Show GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Binary GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

NFData GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

rnf :: GitCommit -> () #

Eq GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep GitCommit = D1 ('MetaData "GitCommit" "Development.Benchmark.Rules" "shake-bench-0.2.0.0-GBfwpyOoQh65kxC6vx003f" 'False) (C1 ('MetaCons "GitCommit" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gitName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "parent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "include") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))