jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject TreeImpl.isRemove performance problem and possible workaround
Date Wed, 07 Nov 2012 14:54:00 GMT

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.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message