From oak-dev-return-2900-apmail-jackrabbit-oak-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Wed Nov 7 14:54:45 2012 Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3920AD2A5 for ; Wed, 7 Nov 2012 14:54:45 +0000 (UTC) Received: (qmail 35331 invoked by uid 500); 7 Nov 2012 14:54:45 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 35141 invoked by uid 500); 7 Nov 2012 14:54:40 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 35114 invoked by uid 99); 7 Nov 2012 14:54:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 14:54:39 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mueller@adobe.com designates 64.18.1.237 as permitted sender) Received: from [64.18.1.237] (HELO exprod6og121.obsmtp.com) (64.18.1.237) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 14:54:29 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob121.postini.com ([64.18.5.12]) with SMTP ID DSNKUJp2D6bgJpPP1vaXPj19q9dyfPRp/twP@postini.com; Wed, 07 Nov 2012 06:54:08 PST Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id qA7EpK1v026012 for ; Wed, 7 Nov 2012 06:51:20 -0800 (PST) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id qA7Es4XM029711 for ; Wed, 7 Nov 2012 06:54:05 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.279.1; Wed, 7 Nov 2012 06:54:04 -0800 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurhub01.eur.adobe.com ([10.128.4.30]) with mapi; Wed, 7 Nov 2012 14:54:00 +0000 From: Thomas Mueller To: "oak-dev@jackrabbit.apache.org" Date: Wed, 7 Nov 2012 14:54:00 +0000 Subject: TreeImpl.isRemove performance problem and possible workaround Thread-Topic: TreeImpl.isRemove performance problem and possible workaround Thread-Index: Ac2897g1iIa3cXX1RbObtbHyGGaPEQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.4.120824 acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_CCC034983688Emuelleradobecom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_CCC034983688Emuelleradobecom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I think this has been discussed before (but I'm not sure): there is a perfo= rmance problem in TreeImpl.isRemoved(). I think I found a temporary workaro= und: --- src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java (revision 14= 06660) +++ src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java (working cop= y) @@ -494,7 +494,8 @@ return true; } try { - return getNodeBuilder().getNodeState() =3D=3D null; + getNodeBuilder().getPropertyCount(); + return false; } catch (IllegalStateException e) { return true; If I understand the code correctly, this avoid creating a copy of the whole= node and just checks if the node is valid (not removed). Use at your own r= isk :-) Of course it's just a workaround, as the code still uses exception handling= for flow control. Regards, Thomas --_000_CCC034983688Emuelleradobecom_--