Class NextFloatGenerationPerformance
- java.lang.Object
-
- org.apache.commons.rng.examples.jmh.core.AbstractBenchmark
-
- org.apache.commons.rng.examples.jmh.core.NextFloatGenerationPerformance
-
public class NextFloatGenerationPerformance extends AbstractBenchmark
Executes benchmark to compare the speed of generation of random numbers from the various source providers forUniformRandomProvider.nextFloat().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNextFloatGenerationPerformance.SourcesThe benchmark state (retrieve the various "RandomSource"s).
-
Constructor Summary
Constructors Constructor Description NextFloatGenerationPerformance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatbaselineFloat()Baseline for a JMH method call returning afloat.voidbaselineVoid()Baseline for a JMH method call with no return value.floatnextFloat(NextFloatGenerationPerformance.Sources sources)Exercise theUniformRandomProvider.nextFloat()method.
-
-
-
Constructor Detail
-
NextFloatGenerationPerformance
public NextFloatGenerationPerformance()
-
-
Method Detail
-
baselineVoid
public void baselineVoid()
Baseline for a JMH method call with no return value.
-
baselineFloat
public float baselineFloat()
Baseline for a JMH method call returning afloat.- Returns:
- the value
-
nextFloat
public float nextFloat(NextFloatGenerationPerformance.Sources sources)
Exercise theUniformRandomProvider.nextFloat()method.- Parameters:
sources- Source of randomness.- Returns:
- the float
-
-