xsl-list
[Top] [All Lists]

optimizing the hell out of XSLT :-)

2002-12-11 20:26:55
Hi Michael and other XSLT engine builders,

among all this lazy evaluation and optimization how about piping SAXON
events right into templates building only partial trees? Suppose a
transform doesn't use global forward access with XPath but only
accesses the local area in the current node and nodes seen before.
Could be a bit faster that way, and more memory efficient? Are you
guys thinking of doing this?

I tried the preview mode in Saxon and that is nice in some special
cases, certainly. But think this could be done generally. I'm not
telling any news I guess.

As for a related matter, how about piping data through variables?
Consider this:

<xsl:variable name="intermediary">
  <xsl:apply-templates mode="preprocess" select="."/>
</xsl:variable>
<xsl:apply-templates select="$intermediary"/>

basically from what I understand about Saxon internals, the
variable body is evaluated by setting the Outputter/Emitter to the
TinytreeBuilder, then the whole thing gets buffered in a new tree.
When that is finished, the second apply-templates is run.

Now, with SAX one cound pipe events right from the result of applying
. in preprocess mode to the next apply-templates. Again, if there is
no forward searching XPath it should go right through.

One notch more: even if there is XPath trying to look ahead a
little bit, one could wait until enough of a tree has been
built. Even if an XPath expression does look ahead through the
whole document (e.g., select="//something") one could apply
that same lazy-evaluation principle (the SequenceIntent class
is already a start.)

Finally, finally, one could have the various apply-template jobs
run in different threads on different CPUs, even through a
network on different machines.

Sounds good, doesn't it? (Especially if I don't have to do all
that :-)

Thanks so much for what you already have done!
regards,
-Gunther


--
Gunther Schadow, M.D., Ph.D.                    
gschadow(_at_)regenstrief(_dot_)org
Medical Information Scientist      Regenstrief Institute for Health Care
Adjunct Assistant Professor        Indiana University School of Medicine
tel:1(317)630-7960                         http://aurora.regenstrief.org



XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>