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. 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);
Flagged as Known Issue as ticket unresolved at the time of writing the release note.
Verification failed on EAP 6.3.0 ER10 - xalan-2.7.1.redhat-7.jar xalan-2.7.1.redhat-7.jar has the same poor performance as xalan-2.7.1.redhat-3.jar from EAP 6.2.0 GA I checked xalan jar file from https://issues.jboss.org/browse/JBPAPP-10994 and its performance in transformation is astonishing. xalan-2.7.1.redhat-7.jar and xalan-2.7.1.redhat-3.jar (total time: 4 minutes 14 seconds) JBPAPP-10994/xalan.jar (total time: 2 seconds) I decompiled xalan-2.7.1.redhat-7.jar and commit https://github.com/jboss/xalan-j/pull/2/files is NOT present.
That PR was never put into wildfly due to the likely regression: https://bugzilla.redhat.com/show_bug.cgi?id=1090544 The issue was closed after not being able to reproduce which I suspect is because as mentioned here 7 did not include the patch. I have reverted the change to the xalan fork we have for now. https://github.com/jboss/xalan-j/pull/3
I forgot to add, that I do not know why -7 did not include the patch
Re-acking after "qa_ack flag reset for and jboss-eap-6.4.0 and jboss-eap-6.4.z items" cleanup.
Verified on EAP 6.4.2 CR1 EAP 6.4.0 GA - total time: 2 minutes 44 seconds EAP 6.4.2 CR1 - total time: 1 second
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.