本文整理汇总了Java中org.openjdk.jmh.annotations.Measurement类的典型用法代码示例。如果您正苦于以下问题:Java Measurement类的具体用法?Java Measurement怎么用?Java Measurement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Measurement类属于org.openjdk.jmh.annotations包,在下文中一共展示了Measurement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: timeMergeAndBuild
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 100, timeUnit = TimeUnit.MICROSECONDS)
@Measurement(iterations = ITERATIONS_COUNT, time = 1000, timeUnit = TimeUnit.MICROSECONDS)
@Fork(1)
public Message timeMergeAndBuild() {
dummy = ++dummy % Integer.MAX_VALUE;
Builder builder = newBuilder(expectedMessage)
.getFieldBuilder(galaxyStar, 0)
.setField(starName, String.valueOf(dummy))
.mergeFrom(mergeStar1Message)
.getFieldBuilder(starPlanet, 0)
.mergeFrom(mergePlanet1Message)
.toParent()
.toParent();
return builder.build();
}
示例2: timeMergeAndBuildOriginalGM
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 100, timeUnit = TimeUnit.MICROSECONDS)
@Measurement(iterations = ITERATIONS_COUNT, time = 1000, timeUnit = TimeUnit.MICROSECONDS)
@Fork(1)
public Galaxy timeMergeAndBuildOriginalGM() {
dummy = ++dummy % Integer.MAX_VALUE;
Galaxy.Builder builder = Galaxy.newBuilder((Galaxy) expectedMessage);
builder.getStarBuilder(0)
.setName(String.valueOf(dummy))
.mergeFrom(mergeStar1Message)
.getPlanetBuilder(0)
.mergeFrom(mergePlanet1Message);
return builder.build();
}
示例3: measureWrong_1
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 5, time = 1)
@BenchmarkMode(Mode.AverageTime)
public List<String> measureWrong_1() {
list.add(list.size() / 2, "something");
return list;
}
示例4: measureWrong_5
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, time = 5)
@Measurement(iterations = 5, time = 5)
@BenchmarkMode(Mode.AverageTime)
public List<String> measureWrong_5() {
list.add(list.size() / 2, "something");
return list;
}
示例5: measureRight
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, batchSize = 5000)
@Measurement(iterations = 5, batchSize = 5000)
@BenchmarkMode(Mode.SingleShotTime)
public List<String> measureRight() {
list.add(list.size() / 2, "something");
return list;
}
示例6: testCascadedValidation
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(value = 1)
@Threads(1)
@Warmup(iterations = 5)
@Measurement(iterations = 20)
public void testCascadedValidation(ParsingBeansSpeedState state, Blackhole bh) {
// Validator in new factory
for ( Object o : state.holder.beans ) {
bh.consume( state.validator.getConstraintsForClass( o.getClass() ).isBeanConstrained() );
}
}
示例7: testCascadedValidation
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@Threads(50)
@Warmup(iterations = 20) // it seems that as there are a lot of beans it takes some time to warmup
@Measurement(iterations = 30)
public void testCascadedValidation(RawValidationSpeedState state, Blackhole bh) {
for ( Object o : state.holder.beans ) {
Set<ConstraintViolation<Object>> constraintViolations = state.validator.validate( o );
bh.consume( constraintViolations );
}
}
示例8: sortNewWay
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Warmup(iterations = 20)
@Measurement(iterations = 10)
@Benchmark
public void sortNewWay() {
for (int i = 0; i < NUMBER_OF_ITERATIONS; i++) {
SortingLongTestJMH.sort(this.array, 0, this.array.length - 1, null, 0, 0);
}
}
示例9: sortOldWay
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Warmup(iterations = 20)
@Measurement(iterations = 10)
@Benchmark
public void sortOldWay() {
for (int i = 0; i < NUMBER_OF_ITERATIONS; i++) {
Arrays.sort(this.array);
}
}
示例10: sortNewWay
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Warmup(iterations = 20)
@Measurement(iterations = 10)
@Benchmark
public void sortNewWay() {
for (int i = 0; i < NUMBER_OF_ITERATIONS; i++) {
SortingIntTestJMH.sort(this.array, 0, this.array.length - 1, null, 0, 0);
}
}
示例11: sortCurrentWay
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Warmup(iterations = 20)
@Measurement(iterations = 10)
@Benchmark
public void sortCurrentWay() {
for (int i = 0; i < NUMBER_OF_ITERATIONS; i++) {
Arrays.sort(this.array);
}
}
示例12: write100KSingleNodeWithOneInnerItemInOneCommitBenchmark
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
}
DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
cohort.canCommit().get();
cohort.preCommit().get();
cohort.commit().get();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:AbstractInMemoryDatastoreWriteTransactionBenchmark.java
示例13: write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
cohort.canCommit().get();
cohort.preCommit().get();
cohort.commit().get();
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:AbstractInMemoryDatastoreWriteTransactionBenchmark.java
示例14: write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
}
DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
cohort.canCommit().get();
cohort.preCommit().get();
cohort.commit().get();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:AbstractInMemoryDatastoreWriteTransactionBenchmark.java
示例15: write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark
import org.openjdk.jmh.annotations.Measurement; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
cohort.canCommit().get();
cohort.preCommit().get();
cohort.commit().get();
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:AbstractInMemoryDatastoreWriteTransactionBenchmark.java