Search in sources :

Example 91 with OutputTimeUnit

use of org.openjdk.jmh.annotations.OutputTimeUnit in project druid by druid-io.

the class BoundFilterBenchmark method matchHalfLexicographic.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchHalfLexicographic() {
    final ImmutableBitmap bitmapIndex = HALF_LEXICOGRAPHIC.getBitmapIndex(selector);
    Preconditions.checkState(bitmapIndex.size() > 0 && bitmapIndex.size() < cardinality);
}
Also used : ImmutableBitmap(io.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 92 with OutputTimeUnit

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

the class ParameterizedMessageBenchmark method refactoredFormatTo.

@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public int refactoredFormatTo(final ThreadState state) {
    state.buffer.setLength(0);
    new ParameterizedMessage("pattern {} with {} two parameters and some text", ARGS).formatTo(state.buffer);
    return state.buffer.length();
}
Also used : ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 93 with OutputTimeUnit

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

the class TimeFormatBenchmark method fastDateFormatReuseStringBuilder.

@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public String fastDateFormatReuseStringBuilder(final BufferState state) {
    state.stringBuilder.setLength(0);
    fastDateFormat.format(new Date(), state.stringBuilder);
    return new String(state.stringBuilder);
}
Also used : Date(java.util.Date) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 94 with OutputTimeUnit

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

the class TextEncoderHelperBenchmark method serializableMCD.

@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public long serializableMCD() {
    final String str = PATTERN_M_C_D.toSerializable(EVENT);
    final byte[] data = str.getBytes(CHARSET_DEFAULT);
    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)

Aggregations

BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)94 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)94 Benchmark (org.openjdk.jmh.annotations.Benchmark)93 QueryableIndexSegment (io.druid.segment.QueryableIndexSegment)37 Result (io.druid.query.Result)27 InputRow (io.druid.data.input.InputRow)26 Row (io.druid.data.input.Row)21 TopNResultValue (io.druid.query.topn.TopNResultValue)15 Cursor (io.druid.segment.Cursor)15 ArrayList (java.util.ArrayList)15 QueryableIndexStorageAdapter (io.druid.segment.QueryableIndexStorageAdapter)13 StorageAdapter (io.druid.segment.StorageAdapter)13 List (java.util.List)13 ImmutableBitmap (io.druid.collections.bitmap.ImmutableBitmap)12 BoundDimFilter (io.druid.query.filter.BoundDimFilter)10 DimFilter (io.druid.query.filter.DimFilter)10 OrDimFilter (io.druid.query.filter.OrDimFilter)9 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)9 AndDimFilter (io.druid.query.filter.AndDimFilter)8 FinalizeResultsQueryRunner (io.druid.query.FinalizeResultsQueryRunner)7