package bechamel
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d719040841a1a3be6f93699ae9bf1f8cb2c5d294f0218c0bc0a735386c2d71a0
sha512=dc1233d4dcf01a997a3fcbafc116df0aae22ea5a6c98c09e200e4aa984c558976c8290b3e14b1156519ad12a6cc4b1b9fa4adf3dc2458d373d77a07fb9f7acff
doc/bechamel/Bechamel/Analyze/index.html
Module Bechamel.Analyze
Source
Analyze module.
Micro-benchmark usually uses a linear-regression to estimates the execution time of a code segments. For example, the following table might represent {!Measurement_raw.t} array
collected by Benchmark.run
:
+-----+------+ | run | time | +-----+------+ | 1 | 19 | | 2 | 25 | | 3 | 37 | | 4 | 47 | | 5 | 56 | +-----+------+
Bechamel records 3000 samples and the number of iterations can grows geometrically (see Benchmark.run
). Then, Bechamel can use 2 algorithms:
- Ordinary Least Square
- RANdom SAmple Consensus
The user can choose one of it. Currently, OLS
is the best to use. These algorithms will estimate the actual execution time of the code segment. Using OLS
with the above data would yield an estimated execution time of 9.6
nanoseconds with a goodness of fit (r²
) of 0.992
.
More generally, Bechamel lets the user choose the predictors and responder. Indeed, the user can use others metrics (such as perf
) and the API allows to analyze such metrics together.
Type of analysis.
ols ~r_square ~bootstrap ~predictors
is an Ordinary Least Square analysis on predictors
. It calculates r²
if r_square = true
. bootstrap
defines how many times Bechamel tries to resample measurements.
one analysis measure { Benchmark.stat; lr; kde; }
estimates the actual given measure
for one predictor
. So, one analysis time { Benchmark.stat; lr; kde; }
wants to estimate actual run-time
(or execution time) value, where analysis
is initialized with run
predictor.
val all :
'a t ->
Measure.witness ->
(string, Benchmark.t) Hashtbl.t ->
(string, 'a) Hashtbl.t
all analysis measure tbl
is an application of one
for all results from the given tbl
.