[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: slow xsltproc XInclude processing w/complex docume

Subject: Re: slow xsltproc XInclude processing w/complex document?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Jul 2004 22:37:59 +0100
xsltproc slow speed
Hi Paul,

> I've been running some tests on a document that includes nested
> Xinclude directives. The document is complex: upwards of 1500 files,
> nested to a depth of up to 4 levels. Total size of content is about
> 4.8MB.

As you probably know, XSLT holds the files that it loads in memory.
You haven't said how much memory your machines have, but it might
simply be that holding all those files (and the flattened result
document) in memory is causing problems.

Another thing is that you're traversing every single node in those
documents. Every node visit takes time, because the processor has to
work out what to do with the node, so cutting down the node visits
would be good. You could try, for example, changing the identity
template that you're using at the moment for:

<xsl:template match="node()">
  <xsl:copy-of select="." />
</xsl:template>

<xsl:template match="*[.//xi:include]">
  <xsl:copy>
    <xsl:copy-of select="@*" />
    <xsl:apply-templates />
  </xsl:copy>
</xsl:template>

Overall, though, if speed is an issue, you would be much better off
using a SAX Filter to do the transformation: that way you wouldn't be
storing the documents in memory, each node would have to be visited
only once, and the output can stream out (if that helps). Mind you,
you say that the XInclude resolution is only a test, so perhaps you
can't do your real transformation using SAX...

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.