package ppx_bench
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=be2fa2db5dc1d74dfc58dd0956025424
sha512=3eb9eb071e0effd451e8733b7eb883e44c246ad75c8990cffba3596c1ec95784f57ac63c4cf3966004b83afca4dbf5728fd497e21b1a454116fbba41ff7b24ae
doc/ppx_bench.runtime-lib/Ppx_bench_lib/Benchmark_accumulator/index.html
Module Ppx_bench_lib.Benchmark_accumulatorSource
The point of Benchmark_accumulator is to provide a global place where inline benchmarking macros can register themselves. Once registered here, the benchmarks are retrieved and analyzed using Core_bench.
This module holds the registered benchmarks in a global hashtable indexed by library name. We care about the registered benchmarks if and only if the library is being used in a inline_benchmarks_runner.exe. To avoid building this hashtable in cases where we will not use it, this module peeks into the commandline args of the running program to decide if the benchmarks should be registered or not.
add_environment_var returns true if the benchmarks should be added to the hashtable
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 ->
unitadd_bench registers benchmarks with the global hashtable maintained in ppx_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) ->
unitadd_bench_module adds a bench module name to the benchmarks. This is called by BENCH_MODULE macro