org.openjdk.jmh.annotations.CompilerControl Java Examples

The following examples show how to use org.openjdk.jmh.annotations.CompilerControl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InboundHeadersBenchmark.java    From grpc-nebula-java with Apache License 2.0 5 votes vote down vote up
@CompilerControl(CompilerControl.Mode.INLINE)
private static void clientHandler(Blackhole bh, Http2Headers headers) {
  // NettyClientHandler does not directly access headers, but convert to Metadata immediately.

  bh.consume(headers.add(responseHeaders[0], responseHeaders[1]));
  bh.consume(headers.add(responseHeaders[2], responseHeaders[3]));

  bh.consume(Utils.convertHeaders(headers));
}
 
Example #2
Source File: InboundHeadersBenchmark.java    From grpc-nebula-java with Apache License 2.0 5 votes vote down vote up
@CompilerControl(CompilerControl.Mode.INLINE)
private static void serverHandler(Blackhole bh, Http2Headers headers) {
  for (int i = 0; i < requestHeaders.length; i += 2) {
    bh.consume(headers.add(requestHeaders[i], requestHeaders[i + 1]));
  }

  // Sequence of headers accessed in NettyServerHandler
  bh.consume(headers.get(TE_TRAILERS));
  bh.consume(headers.get(CONTENT_TYPE_HEADER));
  bh.consume(headers.method());
  bh.consume(headers.get(CONTENT_TYPE_HEADER));
  bh.consume(headers.path());

  bh.consume(Utils.convertHeaders(headers));
}
 
Example #3
Source File: InboundHeadersBenchmark.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
@CompilerControl(CompilerControl.Mode.INLINE)
private static void clientHandler(Blackhole bh, Http2Headers headers) {
  // NettyClientHandler does not directly access headers, but convert to Metadata immediately.

  bh.consume(headers.add(responseHeaders[0], responseHeaders[1]));
  bh.consume(headers.add(responseHeaders[2], responseHeaders[3]));

  bh.consume(Utils.convertHeaders(headers));
}
 
Example #4
Source File: InboundHeadersBenchmark.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
@CompilerControl(CompilerControl.Mode.INLINE)
private static void serverHandler(Blackhole bh, Http2Headers headers) {
  for (int i = 0; i < requestHeaders.length; i += 2) {
    bh.consume(headers.add(requestHeaders[i], requestHeaders[i + 1]));
  }

  // Sequence of headers accessed in NettyServerHandler
  bh.consume(headers.get(TE_TRAILERS));
  bh.consume(headers.get(CONTENT_TYPE_HEADER));
  bh.consume(headers.method());
  bh.consume(headers.get(CONTENT_TYPE_HEADER));
  bh.consume(headers.path());

  bh.consume(Utils.convertHeaders(headers));
}
 
Example #5
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public boolean onError(
    final ValidationError error,
    final long messageType,
    final int tagNumber,
    final AsciiFieldFlyweight value)
{
    bh.consume(error);
    bh.consume(messageType);
    bh.consume(tagNumber);
    bh.consume(value);
    return false;
}
 
Example #6
Source File: JMHSample_32_BulkWarmup.java    From jmh-playground with Apache License 2.0 5 votes vote down vote up
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public int measure(Counter c) {
    int s = 0;
    for (int i = 0; i < 10; i++) {
        s += c.inc();
    }
    return s;
}
 
Example #7
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupEnd(final int tag, final int numInGroup, final int index)
{
    bh.consume(tag);
    bh.consume(numInGroup);
    bh.consume(index);
    return MessageControl.CONTINUE;
}
 
Example #8
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupBegin(final int tag, final int numInGroup, final int index)
{
    bh.consume(tag);
    bh.consume(numInGroup);
    bh.consume(index);
    return MessageControl.CONTINUE;
}
 
Example #9
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupHeader(final int tag, final int numInGroup)
{
    bh.consume(tag);
    bh.consume(numInGroup);
    return MessageControl.CONTINUE;
}
 
Example #10
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length)
{
    bh.consume(tag);
    bh.consume(buffer);
    bh.consume(offset);
    bh.consume(length);
    return MessageControl.CONTINUE;
}
 
Example #11
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 5 votes vote down vote up
@CompilerControl(DONT_INLINE)
public boolean onError(
    final ValidationError error,
    final long messageType,
    final int tagNumber,
    final AsciiFieldFlyweight value)
{
    return false;
}
 
Example #12
Source File: MpqDrainFillThroughputBackoffNone.java    From JCTools with Apache License 2.0 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
protected void backoff() {
}
 
Example #13
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onComplete()
{
    return MessageControl.CONTINUE;
}
 
Example #14
Source File: OtfBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onNext()
{
    return MessageControl.CONTINUE;
}
 
Example #15
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onComplete()
{
    return MessageControl.CONTINUE;
}
 
Example #16
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupEnd(final int tag, final int numInGroup, final int index)
{
    return MessageControl.CONTINUE;
}
 
Example #17
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupBegin(final int tag, final int numInGroup, final int index)
{
    return MessageControl.CONTINUE;
}
 
Example #18
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onGroupHeader(final int tag, final int numInGroup)
{
    return MessageControl.CONTINUE;
}
 
Example #19
Source File: OtfNoBlackHoleAcceptor.java    From artio with Apache License 2.0 4 votes vote down vote up
@CompilerControl(DONT_INLINE)
public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length)
{
    return MessageControl.CONTINUE;
}
 
Example #20
Source File: BenchmarkDemo.java    From Learn-Java-12-Programming with MIT License 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.EXCLUDE)
private int anotherMethod(int res, int n){
    return res +=n;
}
 
Example #21
Source File: JMHSample_16_CompilerControl.java    From jmh-playground with Apache License 2.0 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.EXCLUDE)
public void target_exclude() {
    // this method was intentionally left blank
}
 
Example #22
Source File: JMHSample_16_CompilerControl.java    From jmh-playground with Apache License 2.0 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.INLINE)
public void target_inline() {
    // this method was intentionally left blank
}
 
Example #23
Source File: JMHSample_16_CompilerControl.java    From jmh-playground with Apache License 2.0 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void target_dontInline() {
    // this method was intentionally left blank
}
 
Example #24
Source File: JMHSample_34_SafeLooping.java    From jmh-playground with Apache License 2.0 4 votes vote down vote up
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public static void sink(int v) {
    // IT IS VERY IMPORTANT TO MATCH THE SIGNATURE TO AVOID AUTOBOXING.
    // The method intentionally does nothing.
}