Bug 1065128

Summary: [GSS] (6.4.z) Performance issue with Xalan transformer and very large text nodes
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Kyle Lape <klape>
Component: XML FrameworksAssignee: Kyle Lape <klape>
Status: CLOSED CURRENTRELEASE QA Contact: Rostislav Svoboda <rsvoboda>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.1CC: bbaranow, bmaxwell, cdewolf, csutherl, dwalluck, jason.greene, jawilson, jbliznak, klape, myarboro, pslavice, rsvoboda, smumford
Target Milestone: CR1   
Target Release: EAP 6.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
A bug has been found in this release of JBoss EAP 6 that causes performance issues when attempting to convert large text nodes using the Xalan Transformer. When using the Transfomer to convert a StreamSource to DOMResult, the performance of the Transformer decreases as the size of the character data increases. This is a Known Issue and will be corrected in a later release of the product.
Story Points: ---
Clone Of:
: 1181337 (view as bug list) Environment:
Last Closed: 2017-01-17 10:15:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1175982, 1181337, 1219165    

Description Kyle Lape 2014-02-14 01:17:27 UTC
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);

Comment 2 Scott Mumford 2014-04-22 22:40:21 UTC
Flagged as Known Issue as ticket unresolved at the time of writing the release note.

Comment 5 Rostislav Svoboda 2014-07-17 11:45:13 UTC
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.

Comment 6 Jason T. Greene 2014-07-28 19:43:19 UTC
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

Comment 7 Jason T. Greene 2014-07-28 19:52:38 UTC
I forgot to add, that I do not know why -7 did not include the patch

Comment 23 Rostislav Svoboda 2015-04-23 14:28:38 UTC
Re-acking after "qa_ack flag reset for and jboss-eap-6.4.0 and jboss-eap-6.4.z items" cleanup.

Comment 25 Rostislav Svoboda 2015-06-24 10:06:20 UTC
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

Comment 26 Petr Penicka 2017-01-17 10:15:12 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 27 Petr Penicka 2017-01-17 10:16:02 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.