Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E0D742004F5 for ; Fri, 1 Sep 2017 12:31:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DF4F616CC7D; Fri, 1 Sep 2017 10:31:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56E6116CC78 for ; Fri, 1 Sep 2017 12:31:59 +0200 (CEST) Received: (qmail 3970 invoked by uid 500); 1 Sep 2017 10:31:57 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 3952 invoked by uid 99); 1 Sep 2017 10:31:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2017 10:31:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2FD8DF32F8; Fri, 1 Sep 2017 10:31:57 +0000 (UTC) From: bcluap To: dev@cxf.apache.org Reply-To: dev@cxf.apache.org Message-ID: Subject: [GitHub] cxf pull request #310: Cache URITemplates instead of creating them over and ... Content-Type: text/plain Date: Fri, 1 Sep 2017 10:31:57 +0000 (UTC) archived-at: Fri, 01 Sep 2017 10:32:00 -0000 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 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---