Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6652519

JAXP issue 48 : Performance Issue with Xalan Transformer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • saaj1.2, 6
    • xml
    • 1.4
    • generic
    • generic
    • Verified

        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.

              joehw Joe Wang
              joehw Joe Wang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: