Search in sources :

Example 46 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class StringFunctionsBenchmark method benchmarkSubstringStartLengthFromEnd.

@Benchmark
public Slice benchmarkSubstringStartLengthFromEnd(BenchmarkData data) {
    Slice slice = data.getSlice();
    int length = data.getLength();
    return substr(slice, -((length / 2) + 1), length / 2);
}
Also used : Slice(io.airlift.slice.Slice) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 47 with Benchmark

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

the class JmhWaitStategyBenchmark method put.

/**
     * Test PUT operation.
     *
     * @throws Exception If failed.
     */
@Benchmark
public void put() throws Exception {
    int key = ThreadLocalRandom.current().nextInt(CNT);
    cache.put(key, new IntValue(key));
}
Also used : IntValue(org.apache.ignite.internal.benchmarks.model.IntValue) JmhCacheAbstractBenchmark(org.apache.ignite.internal.benchmarks.jmh.cache.JmhCacheAbstractBenchmark) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 48 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project logging-log4j2 by apache.

the class TextEncoderHelperBenchmark method textEncoderEncode.

@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public long textEncoderEncode() {
    final StringBuilderEncoder helper = getEncoder();
    helper.encode(BUFF_TEXT, destination);
    return destination.count;
}
Also used : StringBuilderEncoder(org.apache.logging.log4j.core.layout.StringBuilderEncoder) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 49 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project logging-log4j2 by apache.

the class TextEncoderHelperBenchmark method byteArrayMCD.

@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public long byteArrayMCD() {
    final byte[] data = PATTERN_M_C_D.toByteArray(EVENT);
    ByteBuffer buff = destination.getByteBuffer();
    if (buff.remaining() < data.length) {
        buff = destination.drain(buff);
    }
    buff.put(data);
    return destination.count;
}
Also used : ByteBuffer(java.nio.ByteBuffer) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 50 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project logging-log4j2 by apache.

the class Log4jLogEventBenchmark method createSerializableLogEventProxyWithoutException.

@Benchmark
public Serializable createSerializableLogEventProxyWithoutException(final Blackhole bh) {
    final Log4jLogEvent event = new Log4jLogEvent("a.b.c", null, "a.b.c", Level.INFO, MESSAGE, null, null);
    Serializable obj = Log4jLogEvent.serialize(event, false);
    bh.consume(obj);
    return obj;
}
Also used : Serializable(java.io.Serializable) Log4jLogEvent(org.apache.logging.log4j.core.impl.Log4jLogEvent) 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