Hi,

I think this has been discussed before (but I'm not sure): there is a 
performance problem in TreeImpl.isRemoved(). I think I found a temporary 
workaround:

--- src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java (revision 
1406660)
+++ src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java (working copy)
@@ -494,7 +494,8 @@
             return true;
         }
         try {
-            return getNodeBuilder().getNodeState() == 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 risk 
:-)

Of course it's just a workaround, as the code still uses exception handling for 
flow control.

Regards,
Thomas

Reply via email to