use of org.openjdk.jmh.annotations.CompilerControl in project netty by netty.
the class Utf8EncodingBenchmark method writeGetBytes.
@Benchmark
@CompilerControl(Mode.DONT_INLINE)
public int writeGetBytes() throws UnsupportedEncodingException {
int countBytes = 0;
for (String string : strings) {
buffer.resetWriterIndex();
final byte[] bytes = string.getBytes("UTF-8");
buffer.writeBytes(bytes);
countBytes += buffer.writerIndex();
}
return countBytes;
}
use of org.openjdk.jmh.annotations.CompilerControl in project netty by netty.
the class SearchRealDataBenchmark method findAll.
@Benchmark
@CompilerControl(Mode.DONT_INLINE)
public void findAll(Blackhole blackHole) {
SearchProcessor searchProcessor = searchProcessorFactory.newSearchProcessor();
int pos = 0;
do {
pos = haystack.forEachByte(pos, haystackLength - pos, searchProcessor) + 1;
blackHole.consume(pos);
} while (pos > 0);
}
Aggregations