Comparison of XSLT 2.0 Processors

State: March 2011

For getting a first impression of the performance of several XSLT 2.0 processors, I compared some (most of the)  available processors in executing a particular transformation scenario (system information of the used computer: Intel(R) Atom, 1.60GHz, 0.99GB RAM, Microsoft Windows XP Home Edition, Version 2002, SP 3). The following account should not be understood to be a representative analysis, but rather as a very basic approach to gain some insight in the distinct processors which show quite heterogenous performance, e.g. regarding the speed of the transformation. Reliant and precise facts abut the XSLT processors could only be stated by defining and executing additional tasks. The following processors were part of the comparison:

Each of these processors was tested in processing 19 XSLT transformations using batch scripts on the command line. The following stylesheet was used as the test case:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:template match="/">
<node>
<xsl:copy-of select="for $node in //* return //*[.=$node]"/>
</node>
</xsl:template>
</xsl:stylesheet>

This stylesheet creates a deep copy for every element present in the input, that is it copies the node with all its attributes and descendants. Additional complexity for the copy of the context node saved in the variable $node was added by the XPath predicate [.=$node] which lets the processor compare all nodes from the input document with the context node.

The 19 distinct XML input documents were systematically created. They all contain between 97 and 101 element nodes and differ in the depth of the nesting of the contained elements. The following examples can be used to understand the system behind the varying nesting depth. The first number of the document name provides the number of the direct children of the document root, and the second number stands for the level of depth of the descendants of the direct children of the document root:

1x100.xml

<node> 
<node>
<node>
<!-- recursive nesting (all in all 101 elements), only one leaf node -->
</node>
</node>
</node>

2x50.xml

<node> 
<node>
<!-- recursive nesting (50 node elements) -->
</node>
<node>
<!-- recursive nesting (50 node elements) -->
</node>
</node>

... 3x33.xml, 4x25.xml, 5x20.xml, 6x16.xml, 7x14.xml, 8x12.xml, 9x11.xml, 10x10.xml, 11x9.xml, 12x8.xml, 14x7.xml, 16x6.xml, 20x5.xml, 25x4.xml, 33x3.xml ...

50x2.xml

<node> 
<node>
<node/>
</node>
<!-- 50 times the above structure, all in all 50 leaf nodes -->
</node>

100x1.xml

<node> 
<node/>
<!-- 100 empty node elements, all in all 100 leaf nodes -->
</node>

Since during the XSLT transformation for every present element a deep copy is done, the size of the output increases proportionally with the nesting depth of the elements. As mentioned above the XSLT transformations were executed by using batch processing. Simultaneously, the durations of the transformations have been logged. This demonstrates that the case study only measures performance with regard to speed. Other important factors like memory usage were not recorded. The following figure and table summarize the required processing durations of the different XSLT processors:

Dauer von XSLT-Transformationen verschiedener Prozessoren

 

 100x150x233x325x420x516x614x712x811x910x109x118x127x146x165x204x253x332x501x100
SaxonEE 9.2.1.5n 6,2 6,2 6,21 6,26 6,24 6,23 6,53 6,23 6,29 6,3 6,31 6,29 6,33 6,39 6,48 6,52 6,69 6,84 10,67
SaxonPE 9.2.1.5n 6,01 6,03 6,05 6,05 6,1 6,04 6,08 6,08 6,11 6,17 6,17 6,16 6,17 6,22 6,3 6,33 6,46 6,65 9,5
SaxonB 9.1.0.1n 3,86 3,89 3,91 3,95 3,94 3,97 3,96 3,97 4,03 4,11 4,09 4,09 4,19 4,17 4,29 4,45 4,61 5,13 16,69
SaxonEE 9.2.1.5j 3,67 3,74 3,75 3,76 3,82 3,75 3,73 3,75 3,77 3,79 3,85 3,92 3,81 3,8 3,86 3,94 4,04 4,13 5,73
SaxonPE 9.2.1.5j 3,42 3,43 3,42 3,48 3,42 3,44 3,42 3,42 3,49 3,48 3,47 3,49 3,54 3,49 3,54 3,58 3,74 3,87 5,66
SaxonB 9.1.0.3j 1,92 1,92 1,99 1,98 2,02 1,98 1,99 2,04 1,99 2,05 2,04 2,03 2,05 2,05 2,17 2,23 2,38 2,51 3,82
Altova2008 1,32 1,56 1,75 1,98 2,17 2,27 2,48 2,58 2,91 3,11 3,25 3,31 3,81 4,05 5,19 6,47 7,87 11,6 24,69
Altova2011re 0,78 0,89 0,94 1,03 1,12 1,13 1,25 1,29 1,49 1,55 1,64 1,61 1,86 1,98 2,39 2,83 3,64 5,28 13,31
Altova2011ce 0,78 0,88 0,93 1,03 1,13 1,14 1,25 1,3 1,43 1,55 1,6 1,6 1,86 1,94 2,39 2,83 3,64 5,38 13,25
Gestalt 1,22 1,36 1,43 1,58 1,69 1,66 1,82 1,96 2,06 2,2 2,26 2,29 2,53 2,62 3,24 3,73 4,56 6,46 12,59