Class LXMBenchmark
- java.lang.Object
-
- org.apache.commons.rng.examples.jmh.core.LXMBenchmark
-
public class LXMBenchmark extends Object
Executes a benchmark for operations used in the LXM family of RNGs.Note
Some code in this benchmark is commented out. It requires a higher version of Java than the current target. Bumping the JMH module to a higher minimum java version prevents running benchmarks on the target JVM for the Commons RNG artifacts. Thus these benchmarks must be manually reinstated by uncommenting the code and updating the Java version in the module pom.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLXMBenchmark.LCG128SourceEncapsulates a method to compute an update step on a 128-bit linear congruential generator (LCG).static classLXMBenchmark.LXM128SourceEncapsulates a method to compute an update step on an LXM generator with a 128-bit Linear Congruential Generator.static classLXMBenchmark.UnsignedMultiply128SourceEncapsulates a method to compute an unsigned multiply of two 128-bit values to create a truncated 128-bit result.static classLXMBenchmark.UnsignedMultiplyHighSourceEncapsulates a method to compute an unsigned multiply of 64-bit values to create the upper and optionally low 64-bits of the 128-bit result.
-
Constructor Summary
Constructors Constructor Description LXMBenchmark()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longlcg128(LXMBenchmark.LCG128Source data)Benchmark a 128-bit linear congruential generator.longlxm128(LXMBenchmark.LXM128Source data)Benchmark a LXM generator with a 128-bit linear congruential generator.longunsignedMultiply(LXMBenchmark.UnsignedMultiplyHighSource data)Benchmark an unsigned multiply.longunsignedMultiply128(LXMBenchmark.UnsignedMultiply128Source data)Benchmark a 128-bit unsigned multiply.
-
-
-
Constructor Detail
-
LXMBenchmark
public LXMBenchmark()
-
-
Method Detail
-
unsignedMultiply
public long unsignedMultiply(LXMBenchmark.UnsignedMultiplyHighSource data)
Benchmark an unsigned multiply.- Parameters:
data- the data- Returns:
- the value
-
unsignedMultiply128
public long unsignedMultiply128(LXMBenchmark.UnsignedMultiply128Source data)
Benchmark a 128-bit unsigned multiply.- Parameters:
data- the data- Returns:
- the value
-
lcg128
public long lcg128(LXMBenchmark.LCG128Source data)
Benchmark a 128-bit linear congruential generator.- Parameters:
data- the data- Returns:
- the value
-
lxm128
public long lxm128(LXMBenchmark.LXM128Source data)
Benchmark a LXM generator with a 128-bit linear congruential generator.- Parameters:
data- the data- Returns:
- the value
-
-