Safe Haskell | None |
---|---|
Language | Haskell2010 |
Code for dealing with the BenchSpace
datatype.
- data BenchSpace meaning
- = And [BenchSpace meaning]
- | Or [BenchSpace meaning]
- | Set meaning ParamSetting
- enumerateBenchSpace :: BenchSpace a -> [[(a, ParamSetting)]]
- benchSpaceSize :: BenchSpace a -> Int
- filterBenchmarks :: [String] -> [Benchmark DefaultParamMeaning] -> [Benchmark DefaultParamMeaning]
- filterBenchmark :: [String] -> Benchmark DefaultParamMeaning -> Benchmark DefaultParamMeaning
- disjunctiveNF :: BenchSpace a -> BenchSpace a
Documentation
data BenchSpace meaning Source
A datatype for describing (generating) benchmark configuration spaces. This is accomplished by nested conjunctions and disjunctions. For example, varying threads from 1-32 would be a 32-way Or. Combining that with profiling on/off (product) would create a 64-config space.
While the ParamSetting provides an *implementation* of the behavior, this datatype can also be decorated with a (more easily machine readable) meaning of the corresponding setting. For example, indicating that the setting controls the number of threads.
And [BenchSpace meaning] | |
Or [BenchSpace meaning] | |
Set meaning ParamSetting |
Eq meaning => Eq (BenchSpace meaning) | |
Ord meaning => Ord (BenchSpace meaning) | |
Read meaning => Read (BenchSpace meaning) | |
Show meaning => Show (BenchSpace meaning) | |
Generic (BenchSpace meaning) | |
Out a => Out (BenchSpace a) | |
type Rep (BenchSpace meaning) |
enumerateBenchSpace :: BenchSpace a -> [[(a, ParamSetting)]] Source
Exhaustively compute all configurations described by a benchmark configuration space.
benchSpaceSize :: BenchSpace a -> Int Source
The size of a configuration space. This is equal to the length of
the result returned by enumerateBenchSpace
, but is quicker to
compute.
:: [String] | Patterns which must all be matched. |
-> [Benchmark DefaultParamMeaning] | |
-> [Benchmark DefaultParamMeaning] |
Filter down a list of benchmarks (and their configuration spaces) to only those that have ALL of the pattern arguments occurring somewhere in their printed representation.
This completely removes any benchmark with an empty configuration space (`Or []`).
:: [String] | Patterns which must all be matched. |
-> Benchmark DefaultParamMeaning | |
-> Benchmark DefaultParamMeaning |
Filter down the config space of a benchmark, to only those configurations that have a match for ALL of the pattern arguments occurring somewhere inside them.
A note on semantics:
A benchmark (with its config space) implies a STREAM of concrete benchmark instances.
Each pattern filters out a subset of these instances (either by
matching a varying field like RuntimeEnv
or a static field like
progname
). This function conjoins all the patterns and thus
returns a benchmark that iterates over the INTERSECTION of those
subsets implied by each pattern, respectively.
disjunctiveNF :: BenchSpace a -> BenchSpace a Source
Convert to disjunctive normal form. This can be an exponential increase in the size of the value.