Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38B761976C for ; Thu, 14 Apr 2016 13:15:26 +0000 (UTC) Received: (qmail 17181 invoked by uid 500); 14 Apr 2016 13:15:26 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 17158 invoked by uid 500); 14 Apr 2016 13:15:25 -0000 Mailing-List: contact issues-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 issues@cxf.apache.org Received: (qmail 17143 invoked by uid 99); 14 Apr 2016 13:15:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2016 13:15:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BCD912C1F56 for ; Thu, 14 Apr 2016 13:15:25 +0000 (UTC) Date: Thu, 14 Apr 2016 13:15:25 +0000 (UTC) From: "Neal Hu (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6865) Add cache for target resouce method matching MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241124#comment-15241124 ] Neal Hu commented on CXF-6865: ------------------------------ Please check our my patch. Thanks. > Add cache for target resouce method matching > -------------------------------------------- > > Key: CXF-6865 > URL: https://issues.apache.org/jira/browse/CXF-6865 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Affects Versions: 3.1.6, 3.0.9 > Environment: mac, windows > Reporter: Neal Hu > Fix For: 3.0.10, 3.1.7, 3.2.0 > > Attachments: JAXRSInInterceptor.patch, ResourceMethodCache.java > > > Find the target resouce method in JAXRSInInterceptor is time comsuming: > JAXRSInInterceptor.java:159==>JAXRSUtils.selectResourceClass(resources, rawPath, message); > Adding cache for the ori, matchedvalues and mediatype will improve the performence. > The bottleneck of the CXF implementation is recursiive searching the target root resouce classes. > {code:java} > String ckey = message.get(Message.BASE_PATH) + ":" + rawPath + ":" + httpMethod + ":" + requestContentType + ":" + acceptTypes; > if (resourceMethodCache != null) { > ResourceMethodCache rmCache = resourceMethodCache.get(ckey); > if (rmCache != null) { > ori = rmCache.getOperationResourceInfo(); > matchedValues = rmCache.getValues(); > String mediaType = rmCache.getMediaType(); > if (!ori.isSubResourceLocator() && mediaType != null) { > message.getExchange().put(Message.CONTENT_TYPE, mediaType); > } > setExchangeProperties(message, exchange, ori, matchedValues, resources.size()); > shouldFind = false; > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)