Java Code Examples for org.openjdk.jmh.annotations.Mode#All

The following examples show how to use org.openjdk.jmh.annotations.Mode#All . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeOneChildSegment(SingleLevelSegmentState state) {
    return state.oneChildSegment.serialize();
}
 
Example 2
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void endSegmentNoChildBenchmark(SegmentNoChildRecorderState state) {
    state.recorder.endSegment();
}
 
Example 3
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void endSegmentWithChildBenchmark(PopulatedRecorderState state) {
    state.recorder.endSubsegment();
    state.recorder.endSegment();
}
 
Example 4
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void endSegmentBenchmark(SegmentNoChildRecorderState state) {
    state.recorder.endSegment();
}
 
Example 5
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeZeroChildSegment(SingleLevelSegmentState state) {
    return state.emptySegment.serialize();
}
 
Example 6
Source File: EntityBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void putAnnotationBenchmark(BenchmarkState state) {
    state.parentSegment.putAnnotation("Key", "Value");
}
 
Example 7
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeFourGenerationSegment(MultiLevelSegmentState state) {
    return state.fourLevelSegment.serialize();
}
 
Example 8
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public Subsegment beginSubsegmentDummyParentBenchmark(DummyPopulatedRecorderState state) {
    return state.recorder.beginSubsegment(SUBSEGMENT_NAME);
}
 
Example 9
Source File: BenchmarkDemo.java    From Learn-Java-12-Programming with MIT License 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void testTheMethod1() {
    SomeClass someClass = new SomeClass();
    int i = 1000;
    int s = 250_000;
    someClass.someMethod(i, s);
}
 
Example 10
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeFourChildSegment(SingleLevelSegmentState state) {
    return state.fourChildSegment.serialize();
}
 
Example 11
Source File: EntityBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void putMetadataBenchmark(BenchmarkState state) {
    state.parentSegment.putMetadata("Key", "Value");
}
 
Example 12
Source File: BenchmarkDemo.java    From Learn-Java-12-Programming with MIT License 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void testTheMethod6(TestState1 state, Blackhole blackhole) {
    SomeClass someClass = new SomeClass();
    blackhole.consume(someClass.someMethod(state.m, state.s));
}
 
Example 13
Source File: LocalizedSamplingStrategyBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public boolean defaultSamplingRuleBenchmark(DefaultSamplingRulesState state) {
    return state.samplingStrategy.shouldTrace(state.samplingRequest).isSampled();
}
 
Example 14
Source File: LocalizedSamplingStrategyBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public boolean noSampleSamplingBenchmark(NoSampleSamplingRulesState state) {
    return state.samplingStrategy.shouldTrace(state.samplingRequest).isSampled();
}
 
Example 15
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeThreeChildSegment(SingleLevelSegmentState state) {
    return state.threeChildSegment.serialize();
}
 
Example 16
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void beginEndDummySegmentSubsegmentBenchmark(RecorderState state) {
    state.recorder.beginDummySegment();
    state.recorder.beginSubsegment(SUBSEGMENT_NAME);
    state.recorder.endSubsegment();
    state.recorder.endSegment();
}
 
Example 17
Source File: AWSXRayRecorderBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void endSubsegmentBenchmark(PopulatedRecorderState state) {
    state.recorder.endSubsegment();
}
 
Example 18
Source File: RheaKVGetBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void get() {
    ThreadLocalRandom random = ThreadLocalRandom.current();
    byte[] key = BytesUtil.writeUtf8("benchmark_" + random.nextInt(KEY_COUNT));
    this.kvStore.get(key, false);
}
 
Example 19
Source File: EntitySerializerBenchmark.java    From aws-xray-sdk-java with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@Fork(value=1)
@Warmup(iterations = 20)
@Measurement(iterations = 20)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String serializeThreeGenerationSegment(MultiLevelSegmentState state) {
    return state.threeLevelSegment.serialize();
}
 
Example 20
Source File: RawKVPutBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.All)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void put() {
    ThreadLocalRandom random = ThreadLocalRandom.current();
    byte[] key = BytesUtil.writeUtf8("benchmark_" + random.nextInt(KEY_COUNT));
    super.kvStore.put(key, VALUE_BYTES, null);
}