camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhillary <m...@no33.co.uk>
Subject DefaultJmsKeyFormatStrategy Performance
Date Mon, 25 Jun 2012 16:58:34 GMT
Hi All,

While looking at some performance issues in our application I noticed it was
spending an unexpectedly large amount of time escaping header keys in the
DefaultJmsKeyFormatStrategy. This seems to be down to the use of
String.replace/replaceAll that are implemented using regular expressions. 

I've created a patch that uses Commons Lang StringUtil.replaceEach. In my
tests it's an order of magnitude faster than String.replace/replaceAll. I
also noticed that, for my application at least, that headers are identical
for every message so I cache the result of the escaping in a
ConcurrentHashMap.

The patch can be found here https://issues.apache.org/jira/browse/CAMEL-5396

Thanks,
Mark Hillary

--
View this message in context: http://camel.465427.n5.nabble.com/DefaultJmsKeyFormatStrategy-Performance-tp5715071.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message