public abstract class AbstractBenchmarkTask extends Object
Modifier and Type | Field and Description |
---|---|
protected static Logger |
s_aLogger
logger to use.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractBenchmarkTask() |
Modifier and Type | Method and Description |
---|---|
protected static double |
benchmarkTask(Runnable aTask)
Measures how long it takes to execute the run method of the task arg.
|
protected static void |
logSystemInfo() |
protected static final Logger s_aLogger
protected static void logSystemInfo()
protected static final double benchmarkTask(Runnable aTask)
This method uses the MIN_WARMUP_CALLS and MIN_BENCHMARK_TIME constants to obtain accurate results.
This method explicitly requests garbage collection before doing each benchmark. Therefore, unless you actually want to include the effect of garbage collection in the benchmark, the JVM should use a "stop-the-world" garbage collector, if it is available. (Usually it is. With Sun's tools, this is, in fact, the default garbage collector type.) The type of garbage collectors to avoid are incremental, concurrent, or parallel ones.
aTask
- The task to be executedCopyright © 2014–2015 Philip Helger. All rights reserved.