jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sorel <johann.so...@geomatys.fr>
Subject JCR to SPI performance improvment
Date Thu, 06 Aug 2009 08:23:48 GMT
Hello,

While working with the JCRtoSPI module. I seens a place where an 
instanceof check could lead to
some performance improvements.

for exemple, when you explore a node :

public static void explore(Node n) throws Exception{
        //to some stuff here
        NodeIterator ite = n.getNodes();
        while(ite.hasNext()){
            explore(ite.nextNode());
        }
}

In the JCRtoSPI. this exploration makes succesfully calls on the 
repository service :
- getChildInfos
- getNodeInfo on each childInfo.

An instanceof test on the childInfo object to see if it's already a 
nodeInfo could
avoid the call to getNodeInfo (and all name resolver operations, path 
parsing and so on).
This could be a significant performance gain in some spi implementations 
where childInfo and NodeInfo are the same object.
For exemple a childInfo iterator which is backed by a resultset could 
provide directly nodeinfo/childinfo object
without any extra cost rather than just a childinfo.

I hope my suggestion makes sens.

johann sorel

Mime
View raw message