This benchmark attempts to measure the performance without any context propagation.

@param blackhole a {@link Blackhole} object supplied by JMH
164742
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  @Fork
  public void none(final Blackhole blackhole) {
    MoreExecutors.directExecutor().execute(new MyRunnable(blackhole));
  }
10700
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            JavaClass cls = classContext.getJavaClass();
            for (CompareSpec entry : compareClasses) {
                if (cls.implementationOf(entry.getCompareClass())) {
                    methodInfo = entry.getMethodInfo();
                    stack = new OpcodeStack();
                    super.visitClassContext(classContext);
                    break;
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            methodInfo = null;
            stack = null;
        }
    }
63838
public void perform(GraphRewrite event, EvaluationContext context)
    {
        Variables variables = Variables.instance(event);
        Iterable<? extends WindupVertexFrame> frames = getSelectionManager().getFrames(event, context);

        boolean hasCommitOperation = OperationUtil.hasCommitOperation(operationPerform) || OperationUtil.hasCommitOperation(operationOtherwise);
        boolean hasIterationOperation = OperationUtil.hasIterationProgress(operationPerform)
                    || OperationUtil.hasIterationProgress(operationOtherwise);
        DefaultOperationBuilder commit = new NoOp();
        DefaultOperationBuilder iterationProgressOperation = new NoOp();

        if (!hasCommitOperation || !hasIterationOperation)
        {
            int frameCount = Iterables.size(frames);
            if (frameCount > 100)
            {
                if (!hasCommitOperation)
                    commit = Commit.every(1000);

                if (!hasIterationOperation)
                {
                    // Use 500 here as 100 might be noisy.
                    iterationProgressOperation = IterationProgress.monitoring("Rule Progress", 500);
                }
            }
        }
        Operation commitAndProgress = commit.and(iterationProgressOperation);

        event.getRewriteContext().put(DEFAULT_VARIABLE_LIST_STRING, frames); // set the current frames
        try
        {
            for (WindupVertexFrame frame : frames)
            try
            {
                variables.push();
                getPayloadManager().setCurrentPayload(variables, frame);
                boolean conditionResult = true;
                if (condition != null)
                {
                    final String payloadVariableName = getPayloadVariableName(event, context);
                    passInputVariableNameToConditionTree(condition, payloadVariableName);
                    conditionResult = condition.evaluate(event, context);
                    /*
                     * Add special clear layer for perform, because condition used one and could have added new variables. The condition result put into
                     * variables is ignored.
                     */
                    variables.push();
                    getPayloadManager().setCurrentPayload(variables, frame);
                }
                if (conditionResult)
                {
                    if (operationPerform != null)
                    {
                        operationPerform.perform(event, context);
                    }
                }
                else if (condition != null)
                {
                    if (operationOtherwise != null)
                    {
                        operationOtherwise.perform(event, context);
                    }
                }
                commitAndProgress.perform(event, context);

                getPayloadManager().removeCurrentPayload(variables);
                // remove the perform layer
                variables.pop();
                if (condition != null)
                {
                    // remove the condition layer
                    variables.pop();
                }
            }
            catch (WindupStopException ex)
            {
                throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM+" stop requested in " + this.toString(), ex);
            }
            catch (Exception e)
            {
                throw new WindupException("Failed when iterating " + frame.toPrettyString() + ", due to: " + e.getMessage(), e);
            }
        }
        finally
        {
            event.getRewriteContext().put(DEFAULT_VARIABLE_LIST_STRING, null);
        }
    }
738884
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MICROSECONDS)
  @Fork
  public void manual(Blackhole blackhole) throws InterruptedException {
    Thread t = new Thread(Context.current().wrap(new MyRunnable(blackhole)));
    t.start();
    t.join();
  }
178383
private void tryDispatchBoundaryCallbacks(boolean post) {
        final boolean dispatchBegin = mBoundaryCallbackBeginDeferred
                && mLowestIndexAccessed <= mConfig.prefetchDistance;
        final boolean dispatchEnd = mBoundaryCallbackEndDeferred
                && mHighestIndexAccessed >= size() - 1 - mConfig.prefetchDistance;

        if (!dispatchBegin && !dispatchEnd) {
            return;
        }

        if (dispatchBegin) {
            mBoundaryCallbackBeginDeferred = false;
        }
        if (dispatchEnd) {
            mBoundaryCallbackEndDeferred = false;
        }
        if (post) {
            mMainThreadExecutor.execute(new Runnable() {
                @Override
                public void run() {
                    dispatchBoundaryCallbacks(dispatchBegin, dispatchEnd);
                }
            });
        } else {
            dispatchBoundaryCallbacks(dispatchBegin, dispatchEnd);
        }
    }
1104251
@Benchmark
    public Class<?> benchmarkByteBuddy() {
        return new ByteBuddy()
                .with(TypeValidation.DISABLED)
                .ignore(any())
                .subclass(baseClass)
                .make()
                .load(newClassLoader(), ClassLoadingStrategy.Default.INJECTION)
                .getLoaded();
    }
629704
public void run(Cache<G> cache, Code<G> code) throws APIException, IOException {
		code.code(cache, xgen);
	}
786846
public static HawkBuilder init(Context context) {
    HawkUtils.checkNull("Context", context);
    hawkFacade = null;
    return new HawkBuilder(context);
  }
492073
public boolean runBenchmark() throws SocketViewException {
		final BenchmarkResult res = benchmark.run();
		new TabularSummaryOutput().visitBenchmark(res);
		view.finished();
		return true;
	}
1020737
public static boolean determineObject(String key) {
        if (!exists()) {
            throwThreadCacheNotInitializedException(key);
        }
        final Object obj = threadLocal.get().get(key);
        return obj != null && (boolean) obj;
    }
590128
void blacklistNode(String nodeName, ResourceType resourceType) {
    LOG.info("Node " + nodeName + " has been blacklisted for resource " +
      resourceType);
    clusterManager.getMetrics().setBlacklistedNodes(
        faultManager.getBlacklistedNodeCount());
    deleteAppFromNode(nodeName, resourceType);
  }
125808
@Override
    public void visitClassContext(ClassContext classContext) {
        localHEDetector.visitClassContext(classContext);
        try {
            hangingFieldCandidates = new HashMap<>();
            exemptExecutors = new HashMap<>();
            parseFieldsForHangingCandidates(classContext);

            if (!hangingFieldCandidates.isEmpty()) {
                stack = new OpcodeStack();
                super.visitClassContext(classContext);

                reportHangingExecutorFieldBugs();
            }
        } finally {
            stack = null;
            hangingFieldCandidates = null;
            exemptExecutors = null;
        }

    }
108208
public void code(Cache<G> cache, G xgen) throws APIException, IOException {
		code(null, null,cache,xgen);
	}
828259
@Benchmark
    @OperationsPerInvocation(20)
    public void benchmarkByteBuddyWithPrefix(Blackhole blackHole) {
        blackHole.consume(byteBuddyWithPrefixInstance.method(booleanValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(byteValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(shortValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(intValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(charValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(intValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(longValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(floatValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(doubleValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(stringValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(booleanValue, booleanValue, booleanValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(byteValue, byteValue, byteValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(shortValue, shortValue, shortValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(intValue, intValue, intValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(charValue, charValue, charValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(intValue, intValue, intValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(longValue, longValue, longValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(floatValue, floatValue, floatValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(doubleValue, doubleValue, doubleValue));
        blackHole.consume(byteBuddyWithPrefixInstance.method(stringValue, stringValue, stringValue));
    }
345296
public static void runWith(
      String[] args, Function<BenchmarkSettings, AbstractBenchmarkState<?>> benchmarkStateFactory) {

    BenchmarkSettings settings = BenchmarkSettings.from(args).build();

    AbstractBenchmarkState<?> benchmarkState = benchmarkStateFactory.apply(settings);

    benchmarkState.runForAsync(
        state -> {
          LatencyHelper latencyHelper = new LatencyHelper(state);

          BenchmarkMeter clientToServiceMeter = state.meter("meter.client-to-service");
          BenchmarkMeter serviceToClientMeter = state.meter("meter.service-to-client");

          ThreadLocal<Mono<Client>> clientHolder =
              ThreadLocal.withInitial(() -> state.createClient().cache());

          return i -> {
            Mono<Client> clientMono = clientHolder.get();
            return clientMono.flatMap(
                client -> {
                  clientToServiceMeter.mark();
                  return client
                      .requestResponse(enrichRequest())
                      .map(RequestOneScenario::enrichResponse)
                      .doOnNext(
                          msg -> {
                            serviceToClientMeter.mark();
                            Optional.ofNullable(msg.data())
                                .ifPresent(ReferenceCountUtil::safestRelease);
                            latencyHelper.calculate(msg);
                          })
                      .doOnError(th -> LOGGER.warn("Exception occured on requestResponse: " + th));
                });
          };
        });
  }
27047
@Benchmark
    public ExampleInterface benchmarkJdkProxy() throws Exception {
        return (ExampleInterface) Proxy.newProxyInstance(newClassLoader(),
                new Class<?>[]{baseClass},
                new InvocationHandler() {
                    public Object invoke(Object proxy, Method method, Object[] args) {
                        Class<?> returnType = method.getReturnType();
                        if (returnType.isPrimitive()) {
                            if (returnType == boolean.class) {
                                return defaultBooleanValue;
                            } else if (returnType == byte.class) {
                                return defaultByteValue;
                            } else if (returnType == short.class) {
                                return defaultShortValue;
                            } else if (returnType == char.class) {
                                return defaultCharValue;
                            } else if (returnType == int.class) {
                                return defaultIntValue;
                            } else if (returnType == long.class) {
                                return defaultLongValue;
                            } else if (returnType == float.class) {
                                return defaultFloatValue;
                            } else {
                                return defaultDoubleValue;
                            }
                        } else {
                            return defaultReferenceValue;
                        }
                    }
                }
        );
    }
732486
@Override
    protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrategy.Key key,
                                                                   QueryMethodEvaluationContextProvider evaluationContextProvider) {
        return Optional.ofNullable(EbeanQueryLookupStrategy.create(ebeanServer, key, evaluationContextProvider));
    }