• en

Module Pa_bench_lib

module Benchmark_accumulator : sig
module Current_libname : sig
val set : string -> unit
val unset : unit -> unit
end
module Entry : sig
type indexed_spec = {
arg_name : string;
arg_values : int list;
thunk : int -> unit -> unit;
}
type test_spec =
| Regular_thunk of unit -> unit -> unit
| Indexed_thunk of indexed_spec
type t = {
unique_id : int;
code : string;
type_conv_path : string;
name : string;
filename : string;
line : int;
startpos : int;
endpos : int;
test_spec : test_spec;
bench_module_name : string option;
}
val compare : t -> t -> int
val get_indexed_arg_name : t -> string option
val get_module_name_opt : t -> string option
end
val add_benchmarks_flag : bool
add_benchmarks_flag returns true if the benchmarks should be added to the hashtable
val lookup_lib : libname:string -> Entry.t list
lookup_lib returns all the benchmarks from the specified library
val add_bench : name:string -> code:string -> filename:string -> type_conv_path:string -> line:int -> startpos:int -> endpos:int -> Entry.test_spec -> unit
add_bench registers benchmarks with the global hashtable maintained in pa_bench_lib. This is meant to be called by the code generated for the BENCH and BENCH_INDEXED macros
val add_bench_module : name:string -> code:string -> type_conv_path:string -> filename:string -> line:int -> startpos:int -> endpos:int -> unit -> unit -> unit
add_bench_module adds a bench module name to the benchmarks. This is called by BENCH_MODULE macro
end