From dev-return-29278-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Mon Sep 13 13:45:57 2010 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 90327 invoked from network); 13 Sep 2010 13:45:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 13:45:57 -0000 Received: (qmail 52168 invoked by uid 500); 13 Sep 2010 13:45:57 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 51836 invoked by uid 500); 13 Sep 2010 13:45:54 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 51820 invoked by uid 99); 13 Sep 2010 13:45:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 13:45:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 13:45:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8DDjWCW028170 for ; Mon, 13 Sep 2010 13:45:32 GMT Message-ID: <31758226.153481284385532721.JavaMail.jira@thor> Date: Mon, 13 Sep 2010 09:45:32 -0400 (EDT) From: =?utf-8?Q?Michael_D=C3=BCrig_=28JIRA=29?= To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-2744) Avoid element arrays in PathImpl In-Reply-To: <13481296.97311284045812407.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-2744?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D129087= 83#action_12908783 ]=20 Michael D=C3=BCrig commented on JCR-2744: ------------------------------------ This looks very good to me. Do you have some performance figures already? However I think that RelativePath#getElements() need to improve. The curren= t implementations recursively calls getElements() on the parent and adds it= s own element to the returned array. To do so the returned array needs to b= e copied. Copying the array once for each recursive invocation effectively = results in O(n^2) run time characteristics. I suggest to change the recursi= ve implementation into an iterative one which collects the name elements of= all ancestors of the current path into a pre allocated array.=20 > Avoid element arrays in PathImpl > -------------------------------- > > Key: JCR-2744 > URL: https://issues.apache.org/jira/browse/JCR-2744 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-spi, jackrabbit-spi-commons > Reporter: Jukka Zitting > > The path handling code in spi-commons shows quite often in thread dumps a= nd profiling results, as the current implementation does quite a bit of rep= etitive allocating and copying of path element arrays. We should be able to= streamline and simplify the path handling code by only tracking the latest= path element and a reference to the parent path. To do this efficiently we= may need to adjust some of the Path and PathFactory method declarations (t= hat currently assume element array -based paths) also in the SPI. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.