Hi, I tried to compare performance of LiteralResult output. So I created stylesheet which I used to output 1, 2, 3, 4, 5, 6 thousand elements to file using html output method and ISO-8859-1 encoding. I compared average time of 20 executions of one stylesheet with Xalan 1.0.1 and Xalan 2.2.D13 processors using following steps: - loaded XSLT stylesheet from file - executed it one time - executed it 20 more times and measured time
Stylesheet looked like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="no" encoding="ISO-8859-1"/> <xsl:template match="/"> <xsl:call-template name="html-body"/> <!-- * 1000 --> </xsl:template> <xsl:template name="html-body"> <BODY1>BODY1</BODY1> <!-- 1 thousand elements to output --> <BODY2>BODY2</BODY2> <!-- 2 thousand elements to output --> <BODY3>BODY3</BODY3> <!-- 3 thousand elements to output --> <BODY4>BODY4</BODY4> <!-- 4 thousand elements to output --> <BODY5>BODY5</BODY5> <!-- 5 thousand elements to output --> <BODY6>BODY6</BODY6> <!-- 6 thousand elements to output --> </xsl:template> </xsl:stylesheet> I found interesting the regression on Xalan 2.2.D13 performance with increasing the number of elements. The results are (average time running transformation 20 times in ms): 1000 2000 3000 4000 5000 6000 Xalan 1.0.1 70 82 96 110 114 126 Xalan 2.2.D13 60 118 166 214 270 318 Diff. 14% -44% -73% -95% -137% -152% These results exclude time of loading XML into DTM or other internal structures and so should depict pure transformation time. I used sax events to load XML. For Xalan 1.0.1 increasing number of output elements on 1000 gives average 13% of increased time. In case of 2.2.D13 it is in average 42% and in particular 97% for increasing from 1000 to 2000. After I changed encoding to UTF-8 in <xsl:output> results were almost similar for both processors (for 6000 elements it was 122 ms). I don't understand why outputting in encoding other than UTF-8 drastically decreases performance in one case, but not in the other. I checked conformance of both processors: Xalan 1.0.1 doesn't output attribute values correctly in some cases, but I don't see how it could have affected this case when I didn't use attributes at all. Can somebody check SerializerToXYZ? May be it contains some excessive code. Thanks, Dmitry
