Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10991

Performance issue with Xalan transformer and very large text nodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.3.0.ER3
    • EAP_EWP 5.2.0
    • Other
    • None
    • Hide

      Code to reproduce:

      import java.io.ByteArrayInputStream;
      
      import javax.xml.transform.Transformer;
      import javax.xml.transform.TransformerFactory;
      import javax.xml.transform.TransformerException;
      import javax.xml.transform.TransformerConfigurationException;
      import javax.xml.transform.dom.DOMResult; 
      import javax.xml.transform.stream.StreamSource;
      
        StringBuilder sb = new StringBuilder();
        sb.append("<thing>");
        while(sb.length() < 50*1024*1024) { //50MB
          sb.append("iunfgq0irg02i4t985023gwhj9eroisghvpoweisvdj");  //random blob
        }
        sb.append("</thing>");
        TransformerFactory   tFactory    = TransformerFactory.newInstance();
        Transformer          transformer = tFactory.newTransformer();
        ByteArrayInputStream bais        = new ByteArrayInputStream(sb.toString().getBytes());
        StreamSource         source      = new StreamSource(bais);
        DOMResult            result      = new DOMResult();
      
        transformer.transform(source, result);
      
      Show
      Code to reproduce: import java.io.ByteArrayInputStream; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamSource; StringBuilder sb = new StringBuilder(); sb.append( "<thing>" ); while (sb.length() < 50*1024*1024) { //50MB sb.append( "iunfgq0irg02i4t985023gwhj9eroisghvpoweisvdj" ); //random blob } sb.append( "</thing>" ); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); ByteArrayInputStream bais = new ByteArrayInputStream(sb.toString().getBytes()); StreamSource source = new StreamSource(bais); DOMResult result = new DOMResult(); transformer.transform(source, result);
    • Release Notes
    • Hide
      <para>It was observed that when using the <code>Transfomer</code> to convert a <code>StreamSource</code> to <code>DOMResult</code>, the performance of the Transform was worse as the size of the
      character data increased. For example, if you had a 50MB XML BLOB, this would take a very long time to finish. This issue has been resolved in this release by adjusting both the <code>SAX2DOM</code> and <code>DOMBuilder</code> classes to more efficiently handle larger inputs.</para>
      Show
      <para>It was observed that when using the <code>Transfomer</code> to convert a <code>StreamSource</code> to <code>DOMResult</code>, the performance of the Transform was worse as the size of the character data increased. For example, if you had a 50MB XML BLOB, this would take a very long time to finish. This issue has been resolved in this release by adjusting both the <code>SAX2DOM</code> and <code>DOMBuilder</code> classes to more efficiently handle larger inputs.</para>
    • Documented as Resolved Issue
    • NEW

    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
      character data increases. If you have a 50MB text blob in XML, this will take a very long time to finish.

      Attachments

        Issue Links

          Activity

            People

              rh-ee-klape Kyle Lape
              rhn-support-bmaxwell Brad Maxwell
              Lucas Costi Lucas Costi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: