Safe Haskell | None |
---|
Functions for runtime tests are provided. They are basically a wrapper to a call to the criterion function Criterion.Main.defaultMainWith. The measurement data (usually stored in temp.csv) is than postprocessed by extracting only the mean runtime for each run and tupling it with the respective input seed. Results are then returned as list of tuples and optionally stored in a .sbench file (see Test.File.FileOps).
- runtimeSeries :: (NFData b, Show c, Real c) => EvalMod -> Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]
- runtimeSeriesWith :: (NFData b, Show c, Real c) => Config -> EvalMod -> Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]
- nfRuntimeSeries :: (NFData b, Show c, Real c) => Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]
- whnfRuntimeSeries :: (NFData b, Show c, Real c) => Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]
- scaleRt :: Double -> [(Int, Double)] -> [(Int, Double)]
Documentation
runtimeSeries :: (NFData b, Show c, Real c) => EvalMod -> Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]Source
As runtimeSeriesWith
, but Criterion.Config.Config is set to a default.
:: (NFData b, Show c, Real c) | |
=> Config | |
-> EvalMod | Evaluation level of the input before starting the measurement.
Either weak head normal form ( |
-> Maybe (BuildOptions, ExeOptions, FilePath, Title) | Choose, whether you want to create a .sbench file and if give meta information about build options, execution options as well as the file name for the .sbench file and the title for the measurements that should be stored as meta information. |
-> Algorithm (a -> b) | The function that is to be tested. |
-> DataGen (c -> a) | The input data generator |
-> [Seed c] | Seeds to the input data generator. For each seed a measurement is performed. A list of seeds might be generated via Test.SBench.Auxiliar.Datagen.makeGens |
-> IO [(c, Double)] | series of the measurements as seed-runtime pairs. |
Most general function to perform runtime measurements for a series of inputs.
nfRuntimeSeries :: (NFData b, Show c, Real c) => Maybe (BuildOptions, ExeOptions, FilePath, Title) -> Algorithm (a -> b) -> DataGen (c -> a) -> [Seed c] -> IO [(c, Double)]Source