Why Saxon is the Fastest XSLT Processor

In my previous article "What XSLT Processor is the Fastest?" I have benchmarked performance of MSXML, XslCompiledTransform, Saxon, Xalan and XSLTC processors. The test case was XML Pipeline transforming 14mb XML file — Saxon was the winner.

In this article, I will explain why Saxon wins, despite MSXML is implemented in C/C++ and .NET XslCompiledTransform is compiling.

Most XSLT processor work on top of DOM. They might accept String or Stream on input or produce String or Stream on output, but they all internally use DOM to represent XML. But DOM is heavy.

XSLT processors working on top of DOM do not take into account the specifics of XSLT: read-only input, write-only output, frequent matching, copying nodes. Using DOM internally might look good from code-reuse point of view, but it is just too heavy for XSLT.

Saxon, on contrary, does not use DOM internally. It uses its own model of XML that is highly optimized to XSLT needs: read-only input, write-only output, etc (see above). The computational complexity of such specialized model is significantly lower compared to generic DOM. Once certain (moderate) size of XML is reached, Saxon's specialized XML model totally outperforms generic DOM.

That's why Saxon wins — computational complexity matters, not C++ or Ngen compiling.


Post new comment

The content of this field is kept private and will not be shown publicly.