orpiske commented on code in PR #9986: URL: https://github.com/apache/camel/pull/9986#discussion_r1183687861
########## core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java: ########## @@ -120,11 +123,20 @@ public Object getSource() { @Override public AsyncProducer acquireProducer(Endpoint endpoint) { + // Try to favor thread locality as some data in the producer's cache may be shared among threads, + // triggering cases of false sharing + if (endpoint == lastUsedEndpoint && endpoint.isSingletonProducer()) { + return lastUsedProducer; + } + try { AsyncProducer producer = producers.acquire(endpoint); if (statistics != null) { statistics.onHit(endpoint.getEndpointUri()); } + lastUsedEndpoint = endpoint; Review Comment: Hm, I guess I should synchronize this, then ... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org