use of org.openjdk.jmh.annotations.OutputTimeUnit 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.OutputTimeUnit 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.OutputTimeUnit 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.OutputTimeUnit 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;
}
use of org.openjdk.jmh.annotations.OutputTimeUnit in project grpc-java by grpc.
the class OutboundHeadersBenchmark method encodeClientHeaders.
/**
* This will encode the random metadata fields, and repeatedly lookup the default other headers.
*/
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public ByteBuf encodeClientHeaders() throws Exception {
scratchBuffer.clear();
Http2Headers headers = Utils.convertClientHeaders(metadata, scheme, defaultPath, authority, userAgent);
headersEncoder.encodeHeaders(1, headers, scratchBuffer);
return scratchBuffer;
}
Aggregations