Re: [xsl] Newbie question on XSL transformations: multiple sorts on element attr

Subject: Re: [xsl] Newbie question on XSL transformations: multiple sorts on element attr
From: Abel Braaksma <>
Date: Thu, 08 Feb 2007 13:15:47 +0100
Marco wrote:

Because I'm trying to obtain best performance in the business logic and separate logic from presentation.
For example if my business logic takes 300 msec and my xslt trasform takes 30 msec, I'm happy because even if xslt trasform takes 10% I have separated data from presentation. The same logic in perl takes 600 msec, and xslt trasform takes always 30 msec or similar and so on.
So I'd like to use saxon in c because it offers xslt2 support but in the same way I'd like to continue to use c because my business logic is faster.
This my modest opinion.
Do you make provision for porting saxon in c?

I think you are missing the point here. Performance and separation of logic have little to do with one another. Some people already have stressed that there will not be a port to C++, let alone C. Of course, I cannot talk for Michael, but since .NET and Java together cover close to 99% of the operating systems, including embedded ones, I doubt he will ever go through the trouble of rewriting everything: the only thing to gain is a loss of portability, which cannot be considered a gain.

And like you say above: if your business logic take 300 msec and your xslt transform takes 30 msec, there is nothing more you need to do. Make sure you cache the compiled stylesheets, that will save you a lot of overhead.

I have no idea why you think "xslt transform always takes 30 msec", because there is not such a thing (unless your input is always the same, in which case you won't need to re-transform, in which case you go down to 0 msec). XSLT is an interpreted language and transforms certain input into certain output and each input is different and so is the performance + running time.

Perl is, like XSLT an interpreted language. Perl will be much faster in many respects, in other respects, XSLT will be. C will only be faster in cases where you optimize as much, but you will loose your flexibility. If you use C for your transformations, you do not need XSLT. Saying that "XSLT in C" is faster than Perl, sounds like you miss the point that, regardless your host language, XSLT remains an interpreted language (like Perl is an interpreted language, and is written C as well).

But if you are so fond of C, you should stick to .NET on Linux, because .NET itself is written in C++ by the Microsoft guys. Perhaps the same is true for Mono. Then you have Linux + Mono + .NET + XSLT. Of which all are written C/C++ (apart from XSLT of course, which is still just XSLT: an XML file that is interpreted as a declarative language).

-- Abel

Current Thread