shake-bench-0.1.0.3: Build rules for historical benchmarking
Safe HaskellNone
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 │ └── git-reference │   ├── 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 experiments and versions └── experiment.svg - graph of bytes over elapsed time, for all the included versions

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
Eq GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

Show GetExample Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable 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 -> () #

newtype GetExamples Source #

Constructors

GetExamples () 

Instances

Instances details
Eq GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

Show GetExamples Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable 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 -> () #

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
Eq GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

Show GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable 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 -> () #

type RuleResult GetVersions Source # 
Instance details

Defined in Development.Benchmark.Rules

newtype GetCommitId Source #

Constructors

GetCommitId String 

Instances

Instances details
Eq GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

Show GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

Hashable 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 -> () #

type RuleResult GetCommitId Source # 
Instance details

Defined in Development.Benchmark.Rules

data BuildSystem Source #

Default build system that handles Cabal and Stack

Constructors

Cabal 
Stack 

Instances

Instances details
Eq BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Read BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

Show 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 #

Hashable BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

ToJSON BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

FromJSON 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 -> () #

type Rep BuildSystem Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep BuildSystem = D1 ('MetaData "BuildSystem" "Development.Benchmark.Rules" "shake-bench-0.1.0.3-9iZtOhtMvLmBAUDRjvlAYZ" '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
Eq a => Eq (Unescaped a) Source # 
Instance details

Defined in Development.Benchmark.Rules

Methods

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

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

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

Defined in Development.Benchmark.Rules

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

Defined in Development.Benchmark.Rules

Methods

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

hash :: Unescaped a -> Int #

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

Defined in Development.Benchmark.Rules

FromJSON a => FromJSON (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 -> () #

data GitCommit Source #

Instances

Instances details
Eq GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

Show 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 #

Hashable GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

ToJSON GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

FromJSON 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 -> () #

type Rep GitCommit Source # 
Instance details

Defined in Development.Benchmark.Rules

type Rep GitCommit = D1 ('MetaData "GitCommit" "Development.Benchmark.Rules" "shake-bench-0.1.0.3-9iZtOhtMvLmBAUDRjvlAYZ" '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))))