Module Mavryk_benchmark.Benchmark

This module defines several signatures to create a benchmark. * The most generic is S; it provides a rather complete control on benchmark creation. * Simple and Simple_with_num can be used to ease benchmark creation, with simpler parameters. Registration functions in Registration will convert these simple interfaces back to S. * All the common parameters for these signatures are declared in Benchmark_base.

type group =
  1. | Standalone
  2. | Group of string
  3. | Generic

Some benchmarks depend on others, and some are for generic parameters that most benchmarks depend on. We need this information in order to correctly infer the values of parameters after a benchmark run; the user provides it with a group.

* Standalone: benchmarks that don't depend on others (except generic ones). This is the value to use if you're not sure whether you should group your benchmark. * Group: benchmarks that belong to the given inference group. Note that setting a benchmark with a group that is referenced only in this benchmark will produce the same inference results as with Standalone. * Generic: for generic parameters only.

type purpose =
  1. | Other_purpose of string
  2. | Generate_code of string

Described the purpose of the benchmark. * Generate_code of destination: generates code at the given destination file, prefixed by "src/proto_alpha/lib_protocol/" and suffixed by "_costs_generated.ml". * Other_purpose of purpose: any other purpose. The goal is to explain why the function is benchmarked since it does not produce a cost function.

type 'config parameters = {
  1. bench_number : int;
  2. config : 'config;
}

Benchmark parameters.

module type Benchmark_base = sig ... end

Common declarations used by the different module types of benchmarks

module type Simple = sig ... end

A simplification of S below, when only one model is defined and no particular process is needed to generate benchmarks.

module type Simple_with_num = sig ... end

A simplification of S below, when only one model is defined.

module type S = sig ... end

The module type of benchmarks

type t = (module S)
type simple = (module Simple)
type simple_with_num = (module Simple_with_num)
val pp : Stdlib.Format.formatter -> t -> unit
type ('cfg, 'workload) poly = (module S with type config = 'cfg and type workload = 'workload)
type packed =
  1. | Ex : ('cfg, 'workload) poly -> packed
val ex_unpack : t -> packed
val name : t -> Namespace.t

Get the name of a benchmark

val info : t -> string

Get the description of a benchmark

val tags : t -> string list

Get the tags of a benchmark

val get_free_variable_set : (module S) -> Free_variable.Set.t

Returns the free variables occur in the models of the benchmark.