Search in sources :

Example 36 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class ReadOnlyHttp2HeadersBenchmark method defaultServerHeaders.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
public int defaultServerHeaders() {
    Http2Headers headers = new DefaultHttp2Headers(false);
    for (int i = 0; i < headerCount; ++i) {
        headers.add(headerNames[i], headerValues[i]);
    }
    headers.status(HttpResponseStatus.OK.codeAsText());
    return iterate(headers);
}
Also used : ReadOnlyHttp2Headers(io.netty.handler.codec.http2.ReadOnlyHttp2Headers) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 37 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class ByteBufAllocatorBenchmark method unpooledHeapAllocAndFree.

@Benchmark
public void unpooledHeapAllocAndFree() {
    int idx = rand.nextInt(unpooledHeapBuffers.length);
    ByteBuf oldBuf = unpooledHeapBuffers[idx];
    if (oldBuf != null) {
        oldBuf.release();
    }
    unpooledHeapBuffers[idx] = unpooledAllocator.heapBuffer(size);
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 38 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class ByteBufAllocatorBenchmark method pooledDirectAllocAndFree.

@Benchmark
public void pooledDirectAllocAndFree() {
    int idx = rand.nextInt(pooledDirectBuffers.length);
    ByteBuf oldBuf = pooledDirectBuffers[idx];
    if (oldBuf != null) {
        oldBuf.release();
    }
    pooledDirectBuffers[idx] = pooledAllocator.directBuffer(size);
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 39 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class ByteBufAllocatorBenchmark method unpooledDirectAllocAndFree.

@Benchmark
public void unpooledDirectAllocAndFree() {
    int idx = rand.nextInt(unpooledDirectBuffers.length);
    ByteBuf oldBuf = unpooledDirectBuffers[idx];
    if (oldBuf != null) {
        oldBuf.release();
    }
    unpooledDirectBuffers[idx] = unpooledAllocator.directBuffer(size);
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 40 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class ByteBufAllocatorBenchmark method defaultPooledHeapAllocAndFree.

@Benchmark
public void defaultPooledHeapAllocAndFree() {
    int idx = rand.nextInt(defaultPooledHeapBuffers.length);
    ByteBuf oldBuf = defaultPooledHeapBuffers[idx];
    if (oldBuf != null) {
        oldBuf.release();
    }
    defaultPooledHeapBuffers[idx] = PooledByteBufAllocator.DEFAULT.heapBuffer(size);
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Benchmark (org.openjdk.jmh.annotations.Benchmark)142 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)96 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)93 QueryableIndexSegment (io.druid.segment.QueryableIndexSegment)37 Result (io.druid.query.Result)27 InputRow (io.druid.data.input.InputRow)25 Row (io.druid.data.input.Row)21 ArrayList (java.util.ArrayList)17 TopNResultValue (io.druid.query.topn.TopNResultValue)15 Cursor (io.druid.segment.Cursor)15 ImmutableBitmap (io.druid.collections.bitmap.ImmutableBitmap)13 QueryableIndexStorageAdapter (io.druid.segment.QueryableIndexStorageAdapter)13 StorageAdapter (io.druid.segment.StorageAdapter)13 List (java.util.List)13 BoundDimFilter (io.druid.query.filter.BoundDimFilter)9 DimFilter (io.druid.query.filter.DimFilter)9 OperationsPerInvocation (org.openjdk.jmh.annotations.OperationsPerInvocation)9 Page (com.facebook.presto.spi.Page)8 OrDimFilter (io.druid.query.filter.OrDimFilter)8 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)8