[jboss-jira] [JBoss JIRA] (WFLY-2900) Performance issue with Xalan transformer and very large character data nodes
Kyle Lape (JIRA)
issues at jboss.org
Tue Feb 11 00:43:28 EST 2014
Kyle Lape created WFLY-2900:
-------------------------------
Summary: Performance issue with Xalan transformer and very large character data nodes
Key: WFLY-2900
URL: https://issues.jboss.org/browse/WFLY-2900
Project: WildFly
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: XML Frameworks
Reporter: Kyle Lape
Assignee: Jason Greene
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.
Code to reproduce:
{code:java}
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);
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list