Martin Marinov created CAMEL-7374:
-------------------------------------
Summary: Slow message processing due to unnecessary logging
Key: CAMEL-7374
URL: https://issues.apache.org/jira/browse/CAMEL-7374
Project: Camel
Issue Type: Bug
Components: camel-core, camel-jms
Affects Versions: 2.12.1
Environment: Windows 7 Enterprise 64 bit, Oracle JRE 1.7.0.51
Reporter: Martin Marinov
Attachments: hotspot_bad.JPG
org.apache.camel.component.jms.EndpointMessageListener.onMessage, line 68:
LOG.debug("{} consumer received JMS message: {}", endpoint, message);
When debug logging is disabled, the log string from above will not be output
anywhere. Nevertheless, it will still be generated. The problem is that
DefaultEndpoint.toString() calls URISupport.sanitizeUri() which uses regex
pattern matching and replacing to process the passed endpoint URL. The
java.util.regex.Matcher.replaceFirst methods turned out to be rather time
consuming, thus slowing down the message processing and decreasing the message
throughput under high loads.
The same problem is observed in
org.apache.camel.processor.SendProcessor.process(). It causes slower sending.
Commenting the LOG.debug invocations at these places improved the message
throughput almost 3 times! The solution, of course is not comment these lines,
but probably to put them inside
if (LOG.isDebugEnabled()) { } blocks.
--
This message was sent by Atlassian JIRA
(v6.2#6252)