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