Search in sources :

Example 51 with Benchmark

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

the class Log4jLogEventBenchmark method createSerializableLogEventProxyWithException.

@Benchmark
public Serializable createSerializableLogEventProxyWithException(final Blackhole bh) {
    final Log4jLogEvent event = new Log4jLogEvent("a.b.c", null, "a.b.c", Level.INFO, MESSAGE, null, ERROR);
    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)

Example 52 with Benchmark

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

the class MemoryHandlerJULLocationBenchmark method throughputSimple.

@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
public void throughputSimple() {
    final LogRecord logRecord = new LogRecord(java.util.logging.Level.INFO, BenchmarkMessageParams.TEST);
    // force location
    logRecord.getSourceClassName();
    logger.log(logRecord);
}
Also used : LogRecord(java.util.logging.LogRecord) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 53 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project jabref by JabRef.

the class Benchmarks method write.

@Benchmark
public String write() throws Exception {
    BibtexDatabaseWriter<StringSaveSession> databaseWriter = new BibtexDatabaseWriter<>(StringSaveSession::new);
    StringSaveSession saveSession = databaseWriter.savePartOfDatabase(new BibDatabaseContext(database, new MetaData(), new Defaults()), database.getEntries(), new SavePreferences());
    return saveSession.getStringValue();
}
Also used : Defaults(org.jabref.model.Defaults) BibtexDatabaseWriter(org.jabref.logic.exporter.BibtexDatabaseWriter) MetaData(org.jabref.model.metadata.MetaData) SavePreferences(org.jabref.logic.exporter.SavePreferences) StringSaveSession(org.jabref.logic.exporter.StringSaveSession) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 54 with Benchmark

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

the class BitmapIterationBenchmark method constructAndIter.

/**
   * Benchmark of cumulative cost of construction of an immutable bitmap and then iterating over it. This is a pattern
   * from realtime nodes, see {@link io.druid.segment.StringDimensionIndexer#fillBitmapsFromUnsortedEncodedKeyComponent}.
   * However this benchmark is yet approximate and to be improved to better reflect actual workloads of realtime nodes.
   */
@Benchmark
public int constructAndIter(ConstructAndIterState state) {
    int dataSize = state.dataSize;
    int[] data = state.data;
    MutableBitmap mutableBitmap = factory.makeEmptyMutableBitmap();
    for (int i = 0; i < dataSize; i++) {
        mutableBitmap.add(data[i]);
    }
    ImmutableBitmap bitmap = factory.makeImmutableBitmap(mutableBitmap);
    return iter(bitmap);
}
Also used : ImmutableBitmap(io.druid.collections.bitmap.ImmutableBitmap) MutableBitmap(io.druid.collections.bitmap.MutableBitmap) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 55 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark 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)

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