use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.
the class StringFunctionsBenchmark method benchmarkSubstringStartLengthFromEnd.
@Benchmark
public Slice benchmarkSubstringStartLengthFromEnd(BenchmarkData data) {
Slice slice = data.getSlice();
int length = data.getLength();
return substr(slice, -((length / 2) + 1), length / 2);
}
use of org.openjdk.jmh.annotations.Benchmark in project ignite by apache.
the class JmhWaitStategyBenchmark method put.
/**
* Test PUT operation.
*
* @throws Exception If failed.
*/
@Benchmark
public void put() throws Exception {
int key = ThreadLocalRandom.current().nextInt(CNT);
cache.put(key, new IntValue(key));
}
use of org.openjdk.jmh.annotations.Benchmark 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.Benchmark 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.Benchmark in project logging-log4j2 by apache.
the class Log4jLogEventBenchmark method createSerializableLogEventProxyWithoutException.
@Benchmark
public Serializable createSerializableLogEventProxyWithoutException(final Blackhole bh) {
final Log4jLogEvent event = new Log4jLogEvent("a.b.c", null, "a.b.c", Level.INFO, MESSAGE, null, null);
Serializable obj = Log4jLogEvent.serialize(event, false);
bh.consume(obj);
return obj;
}
Aggregations