Package org.teavm.perf
Class BenchmarkOptions
java.lang.Object
org.teavm.perf.BenchmarkOptions
Settings that override settings given by annotations, usually specified via command line.
When neither annotations nor these options specify a setting, defaults are used. Defaults are the same as
JMH ones, except for iteration count, iteration time and number of forks, which are much smaller.
Unlike JVM, code produced by TeaVM needs little warmup: C code is compiled ahead of time, and browsers
tier up hot JS and Wasm code within milliseconds. So short warmup is mostly needed to pick batch size
and short iterations are sufficient to get stable results, while keeping running time reasonable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final IterationSettingsstatic final Set<BenchmarkMode> static final TimeUnitstatic final IterationSettings -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetForks()getModes()intbooleanmatches(BenchmarkInfo benchmark) Checks whether benchmark should run.intresolveForks(BenchmarkInfo benchmark) resolveMeasurement(BenchmarkInfo benchmark) resolveModes(BenchmarkInfo benchmark) intresolveOperationsPerInvocation(BenchmarkInfo benchmark) resolveParamValues(ParamInfo param) resolveTimeUnit(BenchmarkInfo benchmark) resolveWarmup(BenchmarkInfo benchmark) voidsetForks(int forks) voidsetMeasurement(IterationSettings measurement) voidsetModes(Set<BenchmarkMode> modes) voidsetOperationsPerInvocation(int operationsPerInvocation) voidsetTimeUnit(TimeUnit timeUnit) voidsetWarmup(IterationSettings warmup)
-
Field Details
-
DEFAULT_WARMUP
-
DEFAULT_MEASUREMENT
-
DEFAULT_FORKS
public static final int DEFAULT_FORKS- See Also:
-
DEFAULT_MODES
-
DEFAULT_TIME_UNIT
-
-
Constructor Details
-
BenchmarkOptions
public BenchmarkOptions()
-
-
Method Details
-
getIncludes
-
getExcludes
-
getWarmup
-
setWarmup
-
getMeasurement
-
setMeasurement
-
getForks
public int getForks() -
setForks
public void setForks(int forks) -
getModes
-
setModes
-
getTimeUnit
-
setTimeUnit
-
getOperationsPerInvocation
public int getOperationsPerInvocation() -
setOperationsPerInvocation
public void setOperationsPerInvocation(int operationsPerInvocation) -
getParams
-
matches
Checks whether benchmark should run. Like in JMH, patterns are matched against any part of fully qualified benchmark name. -
resolveWarmup
-
resolveMeasurement
-
resolveForks
-
resolveModes
-
resolveTimeUnit
-
resolveOperationsPerInvocation
-
resolveParamValues
-