Re: XSL Optimizations

Subject: Re: XSL Optimizations
From: Lars Marius Garshol <larsga@xxxxxxxxxx>
Date: 20 Jun 1999 14:54:19 +0200
* Jon Smirl
| I'm curious, do any of the current XSL implementation use the input
| document's DTD/schema to reduce the number of templates that must be
| checked as each node is visited? Any ideas if this optimization
| would improve the processing speed very much?

I doubt that this would achieve much of a speed-up since the
information about which nodes a pattern will match is probably best
gleaned from the pattern itself. (Also, DTDs/schemas are not always
available and may well be costly to analyze in their own right.)

An idea that has been floating around in my head is to have a hash
table that maps element type names to a list of templates that may
match elements of the given type.

Another, and rather more ambitious idea is to turn patterns upside
down and have a map from element type names to patterns that may match
some descendant of that element type. Patterns can then be added to
and removed from this list on the way down the tree and patterns
invoked when their last requirement has been satisfied.

However, nice though it may sound, I doubt that the last technique
will actually save more than it costs. Also, chances are that the real
costs of XSL processing lie elsewhere than in the matching of patterns
(at least for non-pathological stylesheets). I'd do a thorough
profiling of an XSL engine before setting to work to eliminate
bottlenecks in it.

--Lars M.

 XSL-List info and archive:

Current Thread