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;
}
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);
}
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();
}
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);
}
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);
}
Aggregations