hi thomasm as discussed in private i noticed that throughout the oak code base we execute internal queries with the following pattern:
- execute oak query
- retrieve resultrows
- calll ResultRow.getPath or ResultRow.getValue(JCR_PATH)
- retrieve the tree associated with the given path
while debugging a problem with kpauls i noticed yesterday that the implementation of ResultRow.getPath actually retrieves the path from a tree, which to my knowledge was created with the Root object that executed the query.
In other words: we retrieve the Tree objects twice with the same ContentSession for the same Root object instead of making use of ResultRow.getTree.
So far I spotted the following locations where this should be improved:
- UserQueryManager and ResultRowToAuthorizable
There might also be room for improvement when it comes to
- IdentifierManager.getReferences (returns iterable of path)
cc: jhoh for your interest