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