Search in sources :

Example 6 with Fork

use of org.openjdk.jmh.annotations.Fork in project spring-cloud-sleuth by spring-cloud.

the class HttpFilterBenchmarks method filterWithSleuth.

@Benchmark
@Measurement(iterations = 5, time = 1)
@Fork(3)
public void filterWithSleuth(BenchmarkContext context) throws ServletException, IOException {
    MockHttpServletRequest request = builder().buildRequest(new MockServletContext());
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.setContentType(MediaType.APPLICATION_JSON_VALUE);
    context.traceFilter.doFilter(request, response, new MockFilterChain());
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockFilterChain(org.springframework.mock.web.MockFilterChain) MockServletContext(org.springframework.mock.web.MockServletContext) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Measurement(org.openjdk.jmh.annotations.Measurement) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 7 with Fork

use of org.openjdk.jmh.annotations.Fork in project spring-cloud-sleuth by spring-cloud.

the class HttpFilterBenchmarks method filterWithoutSleuth.

@Benchmark
@Measurement(iterations = 5, time = 1)
@Fork(3)
public void filterWithoutSleuth(BenchmarkContext context) throws IOException, ServletException {
    MockHttpServletRequest request = builder().buildRequest(new MockServletContext());
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.setContentType(MediaType.APPLICATION_JSON_VALUE);
    context.dummyFilter.doFilter(request, response, new MockFilterChain());
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockFilterChain(org.springframework.mock.web.MockFilterChain) MockServletContext(org.springframework.mock.web.MockServletContext) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Measurement(org.openjdk.jmh.annotations.Measurement) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 8 with Fork

use of org.openjdk.jmh.annotations.Fork in project vert.x by eclipse.

the class HttpServerHandlerBenchmark method vertxOpt.

@Fork(value = 1, jvmArgsAppend = { "-Dvertx.threadChecks=false", "-Dvertx.disableContextTimings=true", "-Dvertx.disableTCCL=true", "-Dvertx.disableHttpHeadersValidation=true" })
@Benchmark
public void vertxOpt() {
    GET.setIndex(readerIndex, writeIndex);
    vertxChannel.writeInbound(GET);
    ByteBuf result = (ByteBuf) vertxChannel.outboundMessages().poll();
    consume(result);
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) CompositeByteBuf(io.netty.buffer.CompositeByteBuf) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 9 with Fork

use of org.openjdk.jmh.annotations.Fork in project cassandra by apache.

the class ChecksumBench method benchPureJavaCrc32c.

@Benchmark
@Fork(value = 1, jvmArgsAppend = { "-Xmx512M", "-Djmh.executor=CUSTOM", "-Djmh.executor.class=org.apache.cassandra.test.microbench.FastThreadExecutor" })
public byte[] benchPureJavaCrc32c() {
    PureJavaCrc32C pureJavaCrc32C = new PureJavaCrc32C();
    pureJavaCrc32C.update(array, 0, array.length);
    return Longs.toByteArray(pureJavaCrc32C.getValue());
}
Also used : PureJavaCrc32C(org.xerial.snappy.PureJavaCrc32C) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 10 with Fork

use of org.openjdk.jmh.annotations.Fork in project cassandra by apache.

the class ChecksumBench method benchHasherCrc32c.

@Benchmark
@Fork(value = 1, jvmArgsAppend = { "-Xmx512M", "-Djmh.executor=CUSTOM", "-Djmh.executor.class=org.apache.cassandra.test.microbench.FastThreadExecutor" })
public byte[] benchHasherCrc32c() {
    Hasher crc32cHasher = Hashing.crc32c().newHasher();
    crc32cHasher.putBytes(array);
    return crc32cHasher.hash().asBytes();
}
Also used : Hasher(com.google.common.hash.Hasher) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Benchmark (org.openjdk.jmh.annotations.Benchmark)11 Fork (org.openjdk.jmh.annotations.Fork)11 Measurement (org.openjdk.jmh.annotations.Measurement)8 Warmup (org.openjdk.jmh.annotations.Warmup)6 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)4 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)3 ByteBuf (io.netty.buffer.ByteBuf)2 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)2 Comparator (java.util.Comparator)2 List (java.util.List)2 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 TreeMap (java.util.TreeMap)2 TimeUnit (java.util.concurrent.TimeUnit)2 Function (java.util.function.Function)2 IntUnaryOperator (java.util.function.IntUnaryOperator)2 Predicate (java.util.function.Predicate)2 ToIntFunction (java.util.function.ToIntFunction)2 ToLongFunction (java.util.function.ToLongFunction)2 Collectors (java.util.stream.Collectors)2