org.neuroph.util.benchmark
Class BenchmarkTask
- java.lang.Object
-
- org.neuroph.util.benchmark.BenchmarkTask
-
- Direct Known Subclasses:
- MyBenchmarkTask
public abstract class BenchmarkTask extends java.lang.ObjectThis class is an abstract base class for specific microbenchmarking tasks
-
-
Constructor Summary
Constructors Constructor and Description BenchmarkTask(java.lang.String name)Creates a new instance of BenchmarkTask with specified name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetName()Gets task nameintgetTestIterations()Gets number of test (benchmarking) iterationsintgetWarmupIterations()Gets number of warmup iterations.abstract voidprepareTest()Any initialization before running performance test (benchmark) goes hereabstract voidrunTest()This method should hold the code to benchmarkvoidsetName(java.lang.String name)Sets task namevoidsetTestIterations(int testIterations)Sets number of test (benchmarking) iterationsvoidsetWarmupIterations(int warmupIterations)Sets the number of warmup iterations
-
-
-
Constructor Detail
-
BenchmarkTask
public BenchmarkTask(java.lang.String name)
Creates a new instance of BenchmarkTask with specified name- Parameters:
name- benchmark task name
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets task name- Returns:
- task name
-
setName
public void setName(java.lang.String name)
Sets task name- Parameters:
name- task name
-
getTestIterations
public int getTestIterations()
Gets number of test (benchmarking) iterations- Returns:
- number of test iterations
-
setTestIterations
public void setTestIterations(int testIterations)
Sets number of test (benchmarking) iterations- Parameters:
testIterations- number of test iterations
-
getWarmupIterations
public int getWarmupIterations()
Gets number of warmup iterations. Warmup iterations are used to run test for some time to stabilize JVM (compiling, optimizations, gc)- Returns:
- number of warmup iterations
-
setWarmupIterations
public void setWarmupIterations(int warmupIterations)
Sets the number of warmup iterations- Parameters:
warmupIterations- number of warmup iterations Warmup iterations are used to run test for some time to stabilize JVM (compiling, optimizations, gc)
-
prepareTest
public abstract void prepareTest()
Any initialization before running performance test (benchmark) goes here
-
runTest
public abstract void runTest()
This method should hold the code to benchmark
-
-
DMelt 3.0 © DataMelt by jWork.ORG