4 Replies Latest reply on Sep 17, 2013 9:58 AM by Horia Chiorean

    jcr.Node.getProperties() performance issue

    Andrey Samuleev Newbie

      We are facing ModeShape performance issue caused by specific implementation of getting Node's properties.

      Node's properties could be obtained by iterator only within JCR session.

      So, when we need a list of nodes with filled properties, we need to retrieve properties from every single node separately.

      It looks like sql subqueries.

      In our case, every call of jcr.Node.getProperties() method takes about 12 ms. But we using this feature quite intensively.

       

      Is there any way to get list of node instances with already filled properties, so we can get it's properties out of session scope?

        • 1. Re: jcr.Node.getProperties() performance issue
          Randall Hauch Master

          Can you provide more details about what your application is doing? Any sample code -- or better yet a test case -- would be great. Is there concurrency involved? Are you using ACLs in the repository? You say that you call "Node.getProperties()" quite intensively - are there multiple threads doing this at the same time, and do they have their own sessions? What is done with the session before the 'getProperties' method is called?

           

          Is there any way to get list of node instances with already filled properties, so we can get it's properties out of session scope?

           

          At this time, there is no way to do this. We do have a separate feature request for something similar (MODE-1226), though the difficult part of that feature request is the reattachment to another session. However, I'm not convinced that detaching a node (or even multiple nodes) would really be that much faster; in fact, there'd have to be extra time spent copying data from the session's cache.

          • 2. Re: jcr.Node.getProperties() performance issue
            Randall Hauch Master

            BTW, this is worth opening a JIRA issue. Would you mind doing that as well?

            • 3. Re: jcr.Node.getProperties() performance issue
              Andrey Samuleev Newbie

              Application is running on WebSphere AS 8, without concurrency and ACLs.

              Before the 'getProperties' this methods can be called within same session:

              session.nodeExists()

              session.getNodeByIdentifier()

              node.getPrimaryNodeType().isNodeType()

              node.getIdentifier()

              node.getNodes()

               

              I have tried to reproduce this issue on standalone test, but 'getProperties()' takes not more than 1 ms.

              So this could be something WebSphere specific, or even JProfiler influence.

              I'll keep trying to figure out the concrete case and its cause.

              • 4. Re: jcr.Node.getProperties() performance issue
                Horia Chiorean Master

                Thanks for investigating this. Even some JProfiler dumps where we can see the ModeShape / ISPN calls would help.