|
| | SortingBenchmark (LineChart p) |
| |
| void | setMaxSize (int size) |
| | Puts a cap on the largest array to be used.
|
| |
| void | setBaseSize (int size) |
| | Smallest array to be used.
|
| |
| void | setIncrement (int inc) |
| | Sets the increment for the benchmark size.
|
| |
| void | setGeometric (double base) |
| | Sets a geometric progression for the benchmark size.
|
| |
| void | linearRange (int baseSize, int maxSize, int nbPoint) |
| | The benchmark will sample a range with a fixed number of points.
|
| |
| void | geometricRange (int baseSize, int maxSize, double base) |
| | The benchmark will sample a range using in geometrically increasing sequence.
|
| |
| void | setGenerator (String generatorName) |
| |
| String | getGenerator () |
| |
| void | run (String algoName, Consumer< int[]> runnable) |
| | benchmark a particular algorithm
|
| |
| void | setTimeCap (long cap_in_ms) |
| | sets an upper bound to the time of a run.
|
| |
| long | getTimeCap () |
| | Return time limit of a run.
|
| |
Benchmarks sorting algorithm.
Benchmarks sorting algorithms and add time series to a LineChart.
The benchmark goes from an initial size controlled by setBaseSize() to a largest size controlled by setMaxSize(). One can also set a maximum time spent on a particular run using setTimeCap().
The benchmark goes from a array size of n to the next one of geoBase * n + increment, where the base is controlled by setGeometric() and increment is controlled by setIncrement(). For simpler use one can set a purley linear sampling with linearRange() or a purely geometric one with geometricRange().
The sorting algorithms must have for prototype: static void mysort(int[]); and can be passed to the run function for being benchmarked. A typical use would look something like
LineChart lc;
sb.linearRange (100, 1000, 5);
sb.run("mysortingalgorithm", MyClass.mysort);
Benchmarks sorting algorithm.
Definition SortingBenchmark.java:41
- Author
- Erik Saule
- Date
- 07/20/2019
| void bridges.benchmark.SortingBenchmark.geometricRange |
( |
int |
baseSize, |
|
|
int |
maxSize, |
|
|
double |
base |
|
) |
| |
The benchmark will sample a range using in geometrically increasing sequence.
The benchmark will sample the range [baseSize; maxSize] using a geometric distribution in base base. That is to say, it will sample baseSize, base*baseSize, base*base*baseSize, ...
- Parameters
-
| baseSize | lower bound of the range sampled |
| maxSize | upper bound of the range sampled |
| base | base of the geometric increase |