Estimate asymptotic complexity from benchmarks over a range of input sizes #111
Labels
Enhancement
Intermediate
Intermediate difficulty. Knowledge of Criterion.rs' internals is recommended.
I'd like to be able to parametrize benchmarks by input size, pass criterion a size range, and have criterion run tests for it.
Ideally, I'd like to configure the step size:
It would be cool if criterion could have a way, of given a range, determine the minimum number of inputs to measure to get a performance curve with a bounded error tolerance.
That is, given my benchmark function
f
, an interval[a, b]
, and the time it takes forf
to run for a given inputi
:Delta_t(f(i))
, compute an approximation to this calledg
(e.g. a polynom, wavelet, fourier series, piece-wise linear function, ...) such that|Delta_t(f(x)) - g(x)| <= C
in[a, b]
whereC
is an upper bound on the approximation error.Another cool thing would be if given the set of steps,
criterion
would try to fit the results using a linear function (N
), logarithmic (logN
), logarithmic times linear (NlogN
), quadratic (N^2
), cubic (N^3
), ... and return which of these functions fit the results best.This could be a way to, for example, estimate the algorithmic complexity of a function empirically.
The text was updated successfully, but these errors were encountered: