jaxp
  1. jaxp
  2. JAXP-48

Performance Issue with Xalan Transformer

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      48

      Description

      It has been observed that when using the Transfomer to convert a StreamSource to
      DOMResult, the performance of Transform gets worse as the size of the
      inputstream increases.

      How to Reproduce :

      The issue manifests in the form of Poor performance of SAAJ for Large Payloads.
      SAAJ RI depends on the Transformer.

      import javax.xml.soap.*;

      long start = System.currentTimeMillis();
      MessageFactory mf =
      MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
      MimeHeaders hdrs = new MimeHeaders();
      hdrs.addHeader("Content-Type", "application/soap+xml");
      SOAPMessage sm = mf.createMessage(hdrs, new FileInputStream(new
      File("msgAttach.xml")));
      SOAPBody body = sm.getSOAPBody();
      long end = System.currentTimeMillis();
      System.out.println("Total Time Taken=" + (end - start)/1000);

      Here msgAttach.xml is basically a SOAP Envelope with a large SOAPBody

      ------------
      Profiling has shown that 99.5% of the time is being spent on in
      CharacterDataImpl.appendData()

      com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.characters(char[], int,
      int) is calling
      com.sun.org.apache.xerces.internal.dom.CharacterDataImpl.appendData(String) and
      99.5% of time is spent here.

        Activity

        Hide
        Joe Wang added a comment -

        Assign to me

        Show
        Joe Wang added a comment - Assign to me
        Hide
        Joe Wang added a comment -

        Fixed in JAXP on java.net. Simple test on a workstation (Sun Ultra 20) shows a
        transformation of the provided xml file (436kb) from StreamSource to DOMResult
        which took over 13 min. before now takes only 172ms after the change.

        Refer also to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6652519

        This fix will be integrated into future jdk5/6 update releases, and jdk7
        development release.

        Show
        Joe Wang added a comment - Fixed in JAXP on java.net. Simple test on a workstation (Sun Ultra 20) shows a transformation of the provided xml file (436kb) from StreamSource to DOMResult which took over 13 min. before now takes only 172ms after the change. Refer also to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6652519 This fix will be integrated into future jdk5/6 update releases, and jdk7 development release.

          People

          • Assignee:
            Joe Wang
            Reporter:
            kumarjayanti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: