Performance of web applications using XSLT
A few events that seemed unrelated at first
prompted me to write this post. In his introductory article on XSLT, Petr Bříza
mentions that the technology is overlooked.
I don’t think XSLT is being overlooked. On the contrary, it has found a place
and is very promising. At the same time, as I said
in the discussion under the article, I don’t think
it suits every kind of server-side work. I rather clumsily brought up the example
of generating dynamic content for every request.
I’d like to clarify what I meant. In the same discussion,
Jiří Kosek points to the use of XSLT as the presentation layer of many web applications, where
every request really does generate a new page. I agree and think it can be a good approach
to the presentation layer. But I have a hard time imagining
dozens of developers running XSLT transformations on, say, a shared PHP
host. That could put a huge load on the server and lead to unreasonably
long response times.
There are several ways to look at XSLT performance. The time it takes
to run a transformation depends on the size of the XML input and on how
the XSLT stylesheet is written, including how complex the XPath expressions are. Performance problems
can be tackled by optimizing the stylesheet, using a translet, adding hardware and so on.
There are several options. But I can’t picture that kind of tuning on
a hosting service shared by dozens or hundreds of developers.
In short, yes to XSLT as a web application’s presentation layer,
while taking particular care to consider the performance implications. The last thing
that prompted this post was Pavel Sýkora’s Cocoon by Example (11) — Performance and Deployment in Other Servlet Containers, since
applications built on the Cocoon application server are based on XSLT transformations.
Related articles
- (Dagblog, February 5, 2004) Translets — Superfast XSL Transformations
- (Dagblog, May 9, 2003) Ten Hot Tips for Java and XSLT
- (Dagblog, February 20, 2004) Replacing xsl:call-template with xsl:apply-templates
Related articles
Related CZ Podcast episodes
- #217 · Ivo Lukačovič
On Windy, JavaScript and building companies. · Czech audio
- #3 · Java 6 SE, Vývoj webových aplikací
Dagi and Filemon discuss Java 6 and web application frameworks. · Czech audio