[ 
https://issues.apache.org/jira/browse/JCRVLT-789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17933874#comment-17933874
 ] 

Julian Reschke commented on JCRVLT-789:
---------------------------------------

Pragmatically, we want to change

  
https://github.com/apache/jackrabbit-filevault/blob/14727e599aec7cfb5135eaa33944a11a391188f6/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java#L713

so that iterating through the child nodes happens less. For that, we'd need to 
move the conditions that would break the iteration outside.

For PathFilterSet, this hack:

{noformat}
diff --git 
a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
 
b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
index 7c757eee..4d1094f1 100644
--- 
a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
+++ 
b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java
@@ -708,6 +708,9 @@ public class AggregateImpl implements Aggregate {
                 include(node, p, path);
             }
         }
+
+        PathFilterSet coverSet = filter.getCoveringFilterSet(node.getPath() + 
"/x");
+
         // include "our" nodes to the include set and delegate the others to 
the
         // respective aggregator building sub aggregates
         NodeIterator nIter = node.getNodes();
@@ -717,7 +720,6 @@ public class AggregateImpl implements Aggregate {
             if (log.isTraceEnabled()) {
                 log.trace("checking " + path);
             }
-            PathFilterSet coverSet = filter.getCoveringFilterSet(path);
             boolean isAncestor = filter.isAncestor(path);
             boolean isIncluded = filter.contains(path);
             if (coverSet == null && !isAncestor) {
{noformat}

indeed works. For "isAncestor" it seems to be harder.

> AggregateImpl might be able to avoid iterating over sibling nodes
> -----------------------------------------------------------------
>
>                 Key: JCRVLT-789
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-789
>             Project: Jackrabbit FileVault
>          Issue Type: Improvement
>          Components: vlt
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Major
>
> See 
> [https://github.com/apache/jackrabbit-filevault/blob/367ffb423d84993c5bb0eb0186f810a58b6227be/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java#L696]
>  
> This code currently iterates unconditionally over child nodes (which is a 
> problem for large collections). We might be able to avoid that by checking 
> the filters before descending.
> I tried a quick hack, and that made tests fail (which is good).
> Will continue with a test case first.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to