miniBill / elm-faster-benchmark / FastBenchmark.Config

Types


type Config graph function

All the information needed to run a benchmark.

Building configuration

init : { graphTitle : graph -> String, functionToString : function -> String, graphCodec : Codec graph, functionCodec : Codec function, graphs : List graph, graphData : graph -> { functions : List function, sizes : List Basics.Int }, runFunction : FastBenchmark.Types.Param graph function -> () -> () } -> Config graph function

Initializes the benchmark configuration with some mandatory options.

withTimeout : Basics.Float -> Config graph function -> Config graph function

Sets a timeout (in ms) for each Param.

withRetry : { times : Basics.Int, percentage : Basics.Float } -> Config graph function -> Config graph function

Try running the benchmark more times (up to times) if max - min would be more than percentage * median.

Reasonable values are 5 for times and 0.5 for percentage.

To params list

params : Config graph function -> List (FastBenchmark.Types.Param graph function)

Gets the list of all possible params to benchmark.

Visualization

functionToString : Config graph function -> function -> String

Converts a function to a user-visible string.

graphTitle : Config graph function -> graph -> String

Gets a graph title.

Other configuration

timeout : Config graph function -> Maybe Basics.Float

Gets the timeout (in ms) for each Param.

retry : Config graph function -> Maybe { times : Basics.Int, percentage : Basics.Float }

Gets the retry configuration.

runFunction : Config graph function -> FastBenchmark.Types.Param graph function -> Benchmark.LowLevel.Operation

Prepares a function for running inside a benchmark

Codecs

functionCodec : Config graph function -> Codec function

Codec for functions.

graphCodec : Config graph function -> Codec graph

Codec for graphs.