Paul
Paul

Reputation: 1383

xslt 1 vs xslt 2 for performance

I've been trying to find benchmarks for xslt 1 vs xslt 2 for for speed performance. Does 2 introduce any performance benefits or does it just have new features (which could increase performance if used correctly).

Upvotes: 2

Views: 641

Answers (2)

Michael Kay
Michael Kay

Reputation: 163585

Actually, all other things being equal, there is a risk that if you move to XSLT 2.0 and don't change anything else, performance could get worse. For example, the semantics of ($a = $b) are a lot more complex in 2.0, because there are many more possible data types to consider, and if you don't take advantage of the ability to declare data types, the system will have to work out at run-time what to do. However, this is compensated by the fact that an XSLT 2.0 processor is likely to have a much more sophisticated and mature optimizer, simply because without this, it can't really do an effective job. So I've seen cases where moving a 1.0 stylesheet from Saxon 6.5 (a 1.0 processor) to Saxon 9.x (a 2.0 processor) gave a 100-fold speed up. But that's all about the implementation, as EJP points out; it's nothing to do with the language.

Upvotes: 3

user207421
user207421

Reputation: 311023

Your question doesn't really make sense. XSLT 1 and 2 are specifications, not implementations. They don't have performance. Implementations have performance. XSLT 2.0 has new features, so you can't compare their performance to that of anything in an XSLT 1 implementation; it also has some clarifications, which can only benefit implementors; apart from that it contains everything that XSLT 1 contains, and there is no reason why implementations should differ in performance of this part.

Upvotes: 7

Related Questions