Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D2CD10E02 for ; Tue, 1 Jul 2014 13:09:25 +0000 (UTC) Received: (qmail 66819 invoked by uid 500); 1 Jul 2014 13:09:24 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 66750 invoked by uid 500); 1 Jul 2014 13:09:24 -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 66682 invoked by uid 99); 1 Jul 2014 13:09:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2014 13:09:24 +0000 Date: Tue, 1 Jul 2014 13:09:24 +0000 (UTC) From: "Thomas Mueller (JIRA)" To: dev@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (JCR-3793) vlt: with many child nodes, NodeNameList.restoreOrder is very slow with Oak 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/JCR-3793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Mueller updated JCR-3793: -------------------------------- Attachment: JCR-3793.patch Potential patch. > vlt: with many child nodes, NodeNameList.restoreOrder is very slow with Oak > --------------------------------------------------------------------------- > > Key: JCR-3793 > URL: https://issues.apache.org/jira/browse/JCR-3793 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Reporter: Thomas Mueller > Attachments: JCR-3793.patch > > > The method org.apache.jackrabbit.vault.fs.api.NodeNameList.restoreOrder re-orders orderable child nodes by using Node.orderBefore. This is very slow if there are many child nodes, specially with Oak (minutes for 10'000 nodes, while only about 1 second for Jackrabbit 2.x). > [~tripod], I wonder if a possible solution is to first check whether re-ordering is needed? For example using: > {noformat} > boolean isOrdered(ArrayList names, Node parent) > throws RepositoryException { > NodeIterator it1 = parent.getNodes(); > for (Iterator it2 = names.iterator(); it2.hasNext();) { > if (!it1.hasNext() || !it1.nextNode().getName().equals(it2.next())) { > return false; > } > } > return !it1.hasNext(); > } > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)