jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: svn commit: r378574 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
Date Mon, 20 Feb 2006 15:20:21 GMT
just wanted to give some more details on the NodeState change I did last 
friday. Even though the actual code change is only minor, the underlying 
concept changed somewhat more significant.

Instead of cloning state information in NodeState on read, child node 
entries, mixin type names and property names are now cloned on write.

Mixin type names are copied on each write, as I think those change only 
rarely and the size of the collection is rather small.

Property names and in particular child node entries now have an 
additional flag that indicates if the collection is shared. The shared 
flag is set if the collection (prop names or child node entries) is 
shallow-copied in NodeState.copy(). From that point on the collection 
must not be changed anymore. If a NodeState modifies e.g. child node 
entries, it first has to check if it is shared and in effect read-only. 
If it is shared the NodeState then clones the read-only child node 
entries, modifies the resulting child node entries and resets the shared 

With this change the usage of ChildNodeEntries.clone() drops significantly.

# of clone() calls while running o.a.j.test.api.TestAll:

Before: ~84'000

After:   ~4'100


mreutegg@apache.org wrote:
> Author: mreutegg
> Date: Fri Feb 17 09:20:00 2006
> New Revision: 378574
> URL: http://svn.apache.org/viewcvs?rev=378574&view=rev
> Log:
> - use copy-on-write in NodeState for: child node entries, mixin type names and property
> Modified:
>     incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
> Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
> URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/NodeState.java?rev=378574&r1=378573&r2=378574&view=diff

View raw message