|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math3.PerfTestUtils
public class PerfTestUtils
Simple benchmarking utilities.
| Nested Class Summary | |
|---|---|
static class |
PerfTestUtils.RunTest
Utility class for storing a test label. |
| Field Summary | |
|---|---|
static double |
NANO_TO_MILLI
Nanoseconds to milliseconds conversion factor (1.0E-6). |
| Constructor Summary | |
|---|---|
PerfTestUtils()
|
|
| Method Summary | |
|---|---|
static StatisticalSummary[] |
time(int repeatChunk,
int repeatStat,
boolean runGC,
Callable<Double>... methods)
Timing. |
static StatisticalSummary[] |
timeAndReport(String title,
int repeatChunk,
int repeatStat,
boolean runGC,
PerfTestUtils.RunTest... methods)
Timing and report (to standard output) the average time and standard deviation of a single call. |
static StatisticalSummary[] |
timeAndReport(String title,
PerfTestUtils.RunTest... methods)
Timing and report (to standard output). |
static double[][][] |
timesAndResults(int repeatChunk,
int repeatStat,
boolean runGC,
Callable<Double>... methods)
Timing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double NANO_TO_MILLI
| Constructor Detail |
|---|
public PerfTestUtils()
| Method Detail |
|---|
public static StatisticalSummary[] time(int repeatChunk,
int repeatStat,
boolean runGC,
Callable<Double>... methods)
repeatChunk - Each timing measurement will done done for that
number of repeats of the code.repeatStat - Timing will be averaged over that number of runs.runGC - Call System.gc() between each timed block. When
set to true, the test will run much slower.methods - Codes being timed.
methods, a
StatisticalSummary of the average times (in milliseconds)
taken by a single call to the call method (i.e. the time
taken by each timed block divided by repeatChunk).
public static double[][][] timesAndResults(int repeatChunk,
int repeatStat,
boolean runGC,
Callable<Double>... methods)
repeatChunk - Each timing measurement will done done for that
number of repeats of the code.repeatStat - Timing will be averaged over that number of runs.runGC - Call System.gc() between each timed block. When
set to true, the test will run much slower.methods - Codes being timed.
methods (first dimension), and
each of the repeatStat runs (second dimension):
call method (i.e. the time taken by each timed block divided
by repeatChunk)
call method.
public static StatisticalSummary[] timeAndReport(String title,
int repeatChunk,
int repeatStat,
boolean runGC,
PerfTestUtils.RunTest... methods)
time method.
title - Title of the test (for the report).repeatChunk - Each timing measurement will done done for that
number of repeats of the code.repeatStat - Timing will be averaged over that number of runs.runGC - Call System.gc() between each timed block. When
set to true, the test will run much slower.methods - Codes being timed.
methods, a statistics of the
average times (in milliseconds) taken by a single call to the
call method (i.e. the time taken by each timed block divided
by repeatChunk).
public static StatisticalSummary[] timeAndReport(String title,
PerfTestUtils.RunTest... methods)
timeAndReport(title, 1000, 10000, false, methods).
title - Title of the test (for the report).methods - Codes being timed.
methods, a statistics of the
average times (in milliseconds) taken by a single call to the
call method (i.e. the time taken by each timed block divided
by repeatChunk).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||