Search in sources :

Example 1 with Fork

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

the class JmhPageLockTrackerBenchmark method lockUnlock.

/**
 *  Mesure cost for (beforelock -> lock -> unlock) operation.
 */
@Benchmark
@BenchmarkMode(Mode.Throughput)
@Fork(1)
@Warmup(iterations = 10)
@Measurement(iterations = 10)
public // @OutputTimeUnit(TimeUnit.MICROSECONDS)
void lockUnlock(ThreadLocalState localState) {
    PageLockListener pl = localState.pl;
    for (int i = 0; i < localState.stackSize; i++) {
        int pageId = i + 1;
        pl.onBeforeReadLock(localState.StructureId, pageId, pageId);
        pl.onReadLock(localState.StructureId, pageId, pageId, pageId);
    }
    for (int i = localState.stackSize; i > 0; i--) {
        int pageId = i;
        pl.onReadUnlock(localState.StructureId, pageId, pageId, pageId);
    }
}
Also used : PageLockListener(org.apache.ignite.internal.processors.cache.persistence.tree.util.PageLockListener) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Fork(org.openjdk.jmh.annotations.Fork) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with Fork

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

the class DigestTypeBenchmark method digestManager.

@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 2, time = 3, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 12, timeUnit = TimeUnit.SECONDS)
@Threads(2)
@Fork(value = 1, warmups = 1)
public void digestManager(MyState state) {
    final ByteBuf buff = state.getByteBuff(state.bufferType);
    final DigestManager dm = state.getDigestManager(state.digest);
    dm.update(buff);
    state.digestBuf.clear();
    dm.populateValueAndReset(state.digestBuf);
}
Also used : CompositeByteBuf(io.netty.buffer.CompositeByteBuf) ByteBuf(io.netty.buffer.ByteBuf) Measurement(org.openjdk.jmh.annotations.Measurement) Threads(org.openjdk.jmh.annotations.Threads) Warmup(org.openjdk.jmh.annotations.Warmup) Fork(org.openjdk.jmh.annotations.Fork) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 3 with Fork

use of org.openjdk.jmh.annotations.Fork in project testcases by coheigea.

the class EncryptionSerializerBenchmark method decryptionStaxSerializer.

@Benchmark
@Fork(1)
@Warmup(iterations = 5)
@Measurement(iterations = 20)
public void decryptionStaxSerializer() throws Exception {
    Serializer serializer = new StaxSerializer();
    Document encryptedDoc = doEncryption(null);
    doDecryption(encryptedDoc, serializer);
}
Also used : StaxSerializer(org.apache.cxf.ws.security.wss4j.StaxSerializer) Document(org.w3c.dom.Document) StaxSerializer(org.apache.cxf.ws.security.wss4j.StaxSerializer) Serializer(org.apache.xml.security.encryption.Serializer) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 4 with Fork

use of org.openjdk.jmh.annotations.Fork in project testcases by coheigea.

the class EncryptionSerializerBenchmark method decryptionDefaultSerializer.

@Benchmark
@Fork(1)
@Warmup(iterations = 5)
@Measurement(iterations = 20)
public void decryptionDefaultSerializer() throws Exception {
    Document encryptedDoc = doEncryption(null);
    doDecryption(encryptedDoc, null);
}
Also used : Document(org.w3c.dom.Document) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Fork(org.openjdk.jmh.annotations.Fork) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 5 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)

Aggregations

Benchmark (org.openjdk.jmh.annotations.Benchmark)9 Fork (org.openjdk.jmh.annotations.Fork)9 Measurement (org.openjdk.jmh.annotations.Measurement)6 Warmup (org.openjdk.jmh.annotations.Warmup)4 ByteBuf (io.netty.buffer.ByteBuf)2 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)2 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)2 MockFilterChain (org.springframework.mock.web.MockFilterChain)2 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)2 MockServletContext (org.springframework.mock.web.MockServletContext)2 Document (org.w3c.dom.Document)2 Hasher (com.google.common.hash.Hasher)1 StaxSerializer (org.apache.cxf.ws.security.wss4j.StaxSerializer)1 PageLockListener (org.apache.ignite.internal.processors.cache.persistence.tree.util.PageLockListener)1 Serializer (org.apache.xml.security.encryption.Serializer)1 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)1 Threads (org.openjdk.jmh.annotations.Threads)1 PureJavaCrc32C (org.xerial.snappy.PureJavaCrc32C)1