Uploaded image for project: 'Jackrabbit FileVault'
  1. Jackrabbit FileVault
  2. JCRVLT-53

vlt: with many child nodes, NodeNameList.restoreOrder is very slow with Oak

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • vlt
    • None

    Description

      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:

          boolean isOrdered(ArrayList<String> names, Node parent)
                  throws RepositoryException {
              NodeIterator it1 = parent.getNodes();
              for (Iterator<String> it2 = names.iterator(); it2.hasNext();) {
                  if (!it1.hasNext() || !it1.nextNode().getName().equals(it2.next())) {
                      return false;
                  }
              }
              return !it1.hasNext();
          }
      

      Attachments

        1. ReorderTest.java
          3 kB
          Thomas Mueller
        2. JCR-3793.patch
          2 kB
          Thomas Mueller

        Activity

          People

            thomasm Thomas Mueller
            thomasm Thomas Mueller
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: