ConstructionPerformance_jmhType_B1
public class ConstructionPerformance
extends java.lang.Object
Note that random number providers are created and then used. Thus the construction time must
be analysed together with the run time performance benchmark (see for example
NextIntGenerationPerformance
and
NextLongGenerationPerformance
).
[Total time] = [Construction time] + [Run time]
Selection of a suitable random number provider based on construction speed should consider when the construction time is a large fraction of the run time. In the majority of cases the run time will be the largest component of the total time and the provider should be selected based on its other properties such as the period, statistical randomness and speed.
Modifier and Type | Class | Description |
---|---|---|
static class |
ConstructionPerformance.IntSizes |
The number of
int values that are required to seed a generator. |
static class |
ConstructionPerformance.LongSizes |
The number of
long values that are required to seed a generator. |
static class |
ConstructionPerformance.Sources |
The benchmark state (retrieve the various "RandomSource"s).
|
Constructor | Description |
---|---|
ConstructionPerformance() |
Default constructor to initialise state.
|
Modifier and Type | Method | Description |
---|---|---|
void |
baselineConsumeObject(org.openjdk.jmh.infra.Blackhole bh) |
Baseline for JMH consuming a number of constructed objects.
|
void |
createByteArray(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createIntArraySeed(ConstructionPerformance.IntSizes sizes,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createLongArraySeed(ConstructionPerformance.LongSizes sizes,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createLongSeed(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createNativeSeed(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createNullSeed(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createSelfSeed(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
Test the native seed with arrays truncated to length 1.
|
void |
createSingleIntegerSeed(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
createSingleLongSeed(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
lookupNewInstance(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
Create a new instance using reflection to lookup the constructor then invoke it.
|
void |
newInstance(ConstructionPerformance.Sources sources,
org.openjdk.jmh.infra.Blackhole bh) |
Create a new instance using reflection with a cached constructor.
|
void |
newISAACRandom(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newJDKRandom(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newKISSRandom(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newMersenneTwister(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newMersenneTwister64(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newMultiplyWithCarry256(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newObject(org.openjdk.jmh.infra.Blackhole bh) |
Baseline for JMH consuming a number of new objects.
|
void |
newSplitMix64(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newTwoCmres(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell1024a(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell19937a(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell19937c(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell44497a(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell44497b(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newWell512a(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoRoShiRo128Plus(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoRoShiRo128StarStar(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoRoShiRo64Star(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoRoShiRo64StarStar(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXorShift1024Star(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXorShift1024StarPhi(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo128Plus(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo128StarStar(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo256Plus(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo256StarStar(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo512Plus(org.openjdk.jmh.infra.Blackhole bh) |
|
void |
newXoShiRo512StarStar(org.openjdk.jmh.infra.Blackhole bh) |
public ConstructionPerformance()
public void baselineConsumeObject(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newObject(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newJDKRandom(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell512a(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell1024a(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell19937a(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell19937c(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell44497a(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newWell44497b(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newMersenneTwister(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newISAACRandom(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newSplitMix64(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXorShift1024Star(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newTwoCmres(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newMersenneTwister64(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newMultiplyWithCarry256(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newKISSRandom(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXorShift1024StarPhi(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoRoShiRo64Star(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoRoShiRo64StarStar(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo128Plus(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo128StarStar(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoRoShiRo128Plus(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoRoShiRo128StarStar(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo256Plus(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo256StarStar(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo512Plus(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newXoShiRo512StarStar(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void newInstance(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
sources
- Source of randomness.bh
- Data sink.java.lang.reflect.InvocationTargetException
- If reflection failed.java.lang.IllegalAccessException
- If reflection failed.java.lang.InstantiationException
- If reflection failed.public void lookupNewInstance(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
sources
- Source of randomness.bh
- Data sink.java.lang.reflect.InvocationTargetException
- If reflection failed.java.lang.IllegalAccessException
- If reflection failed.java.lang.InstantiationException
- If reflection failed.java.lang.SecurityException
- If reflection failed.java.lang.NoSuchMethodException
- If reflection failed.java.lang.IllegalArgumentException
- If reflection failed.public void createNullSeed(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh)
sources
- Source of randomness.bh
- Data sink.public void createNativeSeed(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh)
sources
- Source of randomness.bh
- Data sink.public void createSelfSeed(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh)
This test is the same as createNativeSeed(Sources, Blackhole)
if
the random source native seed is not an array.
sources
- Source of randomness.bh
- Data sink.public void createLongSeed(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh)
sources
- Source of randomness.bh
- Data sink.public void createByteArray(ConstructionPerformance.Sources sources, org.openjdk.jmh.infra.Blackhole bh)
sources
- Source of randomness.bh
- Data sink.public void createIntArraySeed(ConstructionPerformance.IntSizes sizes, org.openjdk.jmh.infra.Blackhole bh)
sizes
- Size of int[]
seed.bh
- Data sink.public void createLongArraySeed(ConstructionPerformance.LongSizes sizes, org.openjdk.jmh.infra.Blackhole bh)
sizes
- Size of long[]
seed.bh
- Data sink.public void createSingleIntegerSeed(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.public void createSingleLongSeed(org.openjdk.jmh.infra.Blackhole bh)
bh
- Data sink.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.