Java Code Examples for org.openjdk.jmh.annotations.Mode#SampleTime
The following examples show how to use
org.openjdk.jmh.annotations.Mode#SampleTime .
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: CallOptionsBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** * Adding custom call options without duplicate keys. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public CallOptions withOption() { CallOptions opts = CallOptions.DEFAULT; for (int i = 0; i < customOptions.size(); i++) { opts = opts.withOption(customOptions.get(i), "value"); } return opts; }
Example 2
Source File: Client.java From rpc-benchmark with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode({ Mode.Throughput, Mode.AverageTime, Mode.SampleTime }) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Override public boolean createUser() throws Exception { return super.createUser(); }
Example 3
Source File: DataAppend.java From cyclops with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Warmup( iterations = 10 ) @Measurement( iterations = 10 ) @Fork(1) public void jsAppend(){ for(int i=0;i<1000;i++){ js= js.append(""+i); } }
Example 4
Source File: StatsTraceContextBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** * Javadoc comment. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public StatsTraceContext newClientContext() { return StatsTraceContext.newClientContext(CallOptions.DEFAULT, emptyMetadata); }
Example 5
Source File: Client.java From rpc-benchmark with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode({ Mode.Throughput, Mode.AverageTime, Mode.SampleTime }) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Override public boolean existUser() throws Exception { return super.existUser(); }
Example 6
Source File: CheckpointBenchmark.java From reactor-core with Apache License 2.0 | 5 votes |
@Benchmark() @OutputTimeUnit(TimeUnit.MILLISECONDS) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(1) @BenchmarkMode({Mode.Throughput, Mode.SampleTime}) public void withFullCheckpoint() { this.findAllUserByName(Flux.just("pedro", "simon", "stephane")) .transform(f -> f.filter(s -> s.startsWith("s"))) .transform(f -> f.elapsed()) .checkpoint("checkpoint description", true) .subscribe(System.out::println, t -> { }); }
Example 7
Source File: Client.java From rpc-benchmark with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode({ Mode.Throughput, Mode.AverageTime, Mode.SampleTime }) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Override public User getUser() throws Exception { return super.getUser(); }
Example 8
Source File: VectorZip.java From cyclops with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Warmup( iterations = 10 ) @Measurement( iterations = 10 ) @Fork(1) public void cyclopsOps() { vector.zip(Vector.range(0,10000)); }
Example 9
Source File: CallOptionsBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** * Adding custom call options, overwritting existing keys. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public CallOptions withOptionDuplicates() { CallOptions opts = allOpts; for (int i = 1; i < shuffledCustomOptions.size(); i++) { opts = opts.withOption(shuffledCustomOptions.get(i), "value2"); } return opts; }
Example 10
Source File: AttachDetachBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** * Javadoc comment. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @GroupThreads(6) public int attachDetach() { Context old = cu.attach(); try { return key.get(); } finally { Context.current().detach(old); } }
Example 11
Source File: BenchmarkDictionaryCreation.java From incubator-pinot with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.MILLISECONDS) public int benchmarkFloatDictionaryCreation() throws IOException { try (SegmentDictionaryCreator dictionaryCreator = new SegmentDictionaryCreator(_sortedFloats, FLOAT_FIELD, INDEX_DIR)) { dictionaryCreator.build(); return dictionaryCreator.indexOfSV(0f); } }
Example 12
Source File: DataAppend.java From cyclops with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Warmup( iterations = 10 ) @Measurement( iterations = 10 ) @Fork(1) public void listAppend(){ for(int i=0;i<1000;i++){ list.add(""+i); } }
Example 13
Source File: Client.java From rpc-benchmark with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode({ Mode.Throughput, Mode.AverageTime, Mode.SampleTime }) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Override public boolean createUser() throws Exception { return super.createUser(); }
Example 14
Source File: AttributesBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** * Javadoc. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public Attributes chain() { Attributes attr = base; for (int i = 0; i < iterations; i++) { attr = attr.toBuilder().set(keys[i], new Object()).build(); } return attr; }
Example 15
Source File: Client.java From rpc-benchmark with Apache License 2.0 | 5 votes |
@Benchmark @BenchmarkMode({ Mode.Throughput, Mode.AverageTime, Mode.SampleTime }) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Override public User getUser() throws Exception { return super.getUser(); }
Example 16
Source File: B3FormatImplBenchmark.java From opencensus-java with Apache License 2.0 | 5 votes |
/** * This benchmark attempts to measure performance of {@link TextFormat#extract(Object, Getter)}. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public SpanContext extract(Data data) throws SpanContextParseException { return data.textFormatBase.extract(data.spanContextHeaders); }
Example 17
Source File: ReadBenchmark.java From grpc-nebula-java with Apache License 2.0 | 5 votes |
/** Perform the read operation. */ @Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void testContextLookup(ContextState state, Blackhole bh) { for (Context.Key<?> key : state.keys) { for (Context ctx : state.contexts) { bh.consume(key.get(ctx)); } } }
Example 18
Source File: ChannelzBenchmark.java From grpc-nebula-java with Apache License 2.0 | 4 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void addServerSocket() { channelz.addServerSocket(serverForServerSocket, serverSocketToAdd); }
Example 19
Source File: ChannelzBenchmark.java From grpc-java with Apache License 2.0 | 4 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void removeServerSocket() { channelz.removeServerSocket(serverForServerSocket, serverSocketToRemove); }
Example 20
Source File: ChannelzBenchmark.java From grpc-java with Apache License 2.0 | 4 votes |
@Benchmark @BenchmarkMode(Mode.SampleTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void remove() { channelz.removeClientSocket(serverSocketToRemove); }