jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject ContentSession.getCurrentRoot() is slow
Date Thu, 13 Sep 2012 15:42:37 GMT
Hi,

To read a node, the query engine currently uses:

    session.getCurrentRoot().getTree(path);

The query engine calls this whenever it has to evaluate a property. It
turns out internally the getCurrentRoot() method always calls
MicroKernel.getHeadRevision(). I wonder if this is required, and if yes,
why? The javadoc for this method is:

    /**
     * The current root as seen by this content session. Use
     * {@link Root#commit(ConflictHandler)} to atomically apply the
changes made in that
     * subtree the underlying Microkernel.
     *
     * @return  the current root
     */

Should I cache the Root instance in the query engine for the duration of a
query? Or would it be possible to change the Root implementation so this
is not needed?

Regards,
Thomas
 


Mime
View raw message