package bechamel

  1. Overview
  2. Docs
type sampling = [
  1. | `Linear of int
  2. | `Geometric of float
]
type configuration

Type of configuration.

val cfg : ?limit:int -> ?quota:Time.span -> ?kde:int option -> ?sampling:sampling -> ?stabilize:bool -> ?start:int -> unit -> configuration

cfg () returns a configuration needed to run a benchmark. It accepts several optional arguments:

  • limit is the maximum of samples allowed (default to 3000).
  • quota is the maximum of time allowed (default to 1 second).
  • kde : optional number of additional measurements taken to enable kde and histogram js display (default None). If kde = Some _, the same time limit quota is applied, meaning the actual time limit for all the benchmarks is actually 2xquota.
  • sampling is the way to grow the run metric (default to `Geometric 1.0.1).
  • stabilize allows the benchamrk to stabilize the garbage collector before each run (default to true).
  • start is the first value of the run metric (default to 1).
type stats = {
  1. start : int;
  2. sampling : sampling;
  3. stabilize : bool;
  4. quota : Time.span;
  5. limit : int;
  6. instances : string list;
  7. samples : int;
  8. time : Time.span;
}

Type of statistics of one benchmark. It contains which configuration the benchmark used and:

  • How long was the benchmark, see time.
  • How many runs the benchmark did, see samples.

It's useful to introspect which limit was reached (the time or the limit of runs).

type t = {
  1. stats : stats;
  2. lr : Measurement_raw.t array;
  3. kde : Measurement_raw.t array option;
}

Results of one benchmark:

  • stats contains all the information about the benchmarks as described above
  • lr contains the measurements necessary for oLS and ransac analysis.
  • kde optionnaly contains more measurements to enable the display of density function (KDE or histogram) with the js display.
val run : configuration -> Measure.witness list -> Test.Elt.t -> t

run cfg measures test returns samples of measures according to the given configuration cfg. It returns statistics of the benchmark too.

val all : configuration -> Measure.witness list -> Test.t -> (string, t) Hashtbl.t

all cfg measures tests calls run for each element of tests (see Test.elements).

OCaml

Innovation. Community. Security.