GitHub user bcluap opened a pull request:
https://github.com/apache/cxf/pull/310
Cache URITemplates instead of creating them over and over resulting iâ¦
â¦n wasted CPU cycles and GC runs. The cache prevents having to compile
java.util.regex.Pattern when the underlying templates seldom change as well as
preventing other fairly heavy lifting each time a template is instantiated.
My load tests show approx 10% throughput increase on a basic JAX-RS service
with 10 client threads in JMeter. My use case uses a lot of URITemplate
instantiation due to calling javax.ws.rs.core.UriInfo.getMatchedURIs() on each
sub-resource call.
I checked that URITemplate is thread safe and hence viable to be used in an
instance cache without the need for additional locking.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bcluap/cxf master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cxf/pull/310.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #310
----
commit bcc909b938051a41284bb4583977386c2c72ea09
Author: Paul <[email protected]>
Date: 2017-09-01T10:24:39Z
Cache URITemplates instead of creating them over and over resulting in
wasted CPU cycles and GC runs. The cache prevents having to compile
java.util.regex.Pattern when the underlying templates seldom change as well as
preventing other fairly heavy lifting each time a template is instantiated.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---