Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3721

Slow and actively called NodeId.toString()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.5, 2.7
    • 2.7.5, 2.6.6
    • jackrabbit-core
    • None
    • Debian/GNU Linux 7.3 / Oracle JDK 7 / Apache Tomcat 7.0;
      Windows Server 2008 / IBM WebSphere AppServer 7.0

    Description

      I performed some JackRabbit profiling while trying to investigate the reason of low performance of our application.

      The mostly interesting thing I've found is that NodeId.toString() method is heavily used for hierarchy-based XPath queries, and it performs really bad.

      This are the numbers for my test application:

      • Total CPU time: 879 178 msec
      • CPU time in NodeId.toString(), including subcalls: 223 705 msec

      A quick check against NodeId.toString() implementation shows that it is based on UUID.toString(), which itself is very ineffective in both in Oracle and IBM JDK.

      I've wrote a quick replacement for this method, and my measurements show that overall performance became significantly better for our case.

      Hope that this will help to improve JackRabbit performance for similiar applications.

      P.S. Another interesting thing I've found is that a lot of time is spent inside log4j.Category.getEffectiveLevel() method - I suspect this is caused by numerous log.debug() calls without proper isDebugEnabled() handling.

      Attachments

        1. NodeIdToString.patch
          1 kB
          Maxim Zinal

        Activity

          People

            jukkaz Jukka Zitting
            zinal Maxim Zinal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: