use of org.openjdk.jmh.annotations.BenchmarkMode in project druid by druid-io.
the class SelectBenchmark method queryMultiQueryableIndex.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void queryMultiQueryableIndex(Blackhole blackhole) throws Exception {
SelectQuery queryCopy = query.withPagingSpec(PagingSpec.newSpec(pagingThreshold));
String segmentName;
List<QueryRunner<Result<SelectResultValue>>> singleSegmentRunners = Lists.newArrayList();
QueryToolChest toolChest = factory.getToolchest();
for (int i = 0; i < numSegments; i++) {
segmentName = "qIndex" + i;
QueryRunner<Result<SelectResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, segmentName, new QueryableIndexSegment(segmentName, qIndexes.get(i)));
singleSegmentRunners.add(toolChest.preMergeQueryDecoration(runner));
}
QueryRunner theRunner = toolChest.postMergeQueryDecoration(new FinalizeResultsQueryRunner<>(toolChest.mergeResults(factory.mergeRunners(executorService, singleSegmentRunners)), toolChest));
boolean done = false;
while (!done) {
Sequence<Result<SelectResultValue>> queryResult = theRunner.run(queryCopy, Maps.<String, Object>newHashMap());
List<Result<SelectResultValue>> results = Sequences.toList(queryResult, Lists.<Result<SelectResultValue>>newArrayList());
SelectResultValue result = results.get(0).getValue();
if (result.getEvents().size() == 0) {
done = true;
} else {
for (EventHolder eh : result.getEvents()) {
blackhole.consume(eh);
}
queryCopy = incrementQueryPagination(queryCopy, result);
}
}
}
use of org.openjdk.jmh.annotations.BenchmarkMode 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;
}
use of org.openjdk.jmh.annotations.BenchmarkMode 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;
}
use of org.openjdk.jmh.annotations.BenchmarkMode 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.BenchmarkMode in project grpc-java by grpc.
the class MethodDescriptorBenchmark method transportSpecific.
/** Foo bar. */
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public AsciiString transportSpecific() {
AsciiString path;
if ((path = (AsciiString) imd.geRawMethodName(method)) != null) {
path = new AsciiString("/" + method.getFullMethodName());
imd.setRawMethodName(method, path);
}
return path;
}
Aggregations