Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-917

Performance Issue - CachedXPathAPI

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4
    • None
    • XPath
    • None
    • Operating System: All
      Platform: All
    • 7294

    Description

      The current implementation of the CachedXPathAPI object creates XPath object
      during the eval(), and provides a "null" ErrorHandling interface.

      // Create the XPath object.
      XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
      ^^^^
      This causes the XPath constructor to create a DefaultErrorHandler. The
      DefaultErrorHandler creates a new PrintWriter around System.err. When there are
      lots of eval() method calls being made using the CachedXPathAPI object, there
      are lots of un-needed DefaultErrorHandlers being created. Through profiling, I
      determined that 30% of the CPU utilization associated with calls to eval() were
      being attributed to creating the DefaultErrorHandlers.

      PROPOSAL:
      I propose that you add functionality to either alter the constructor of the
      CachedXPathAPI object to accept an ErrorHandler:

      public CachedXPathAPI(ErrorHandler); // and variations

      or add proper accessor methods to the CachedXPathAPI object:

      public ErrorHandler getErrorHandler();
      public void setErrorHandler(ErrorHandler errorHandler);

      Thanks,
      Aaron

      Attachments

        Activity

          People

            Unassigned Unassigned
            ahughes@tutsys.com Aaron Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: