xsl-list
[Top] [All Lists]

RE: csv slows down transform

2004-10-06 02:47:34
Performance questions are always specific to the product. I don't know
libxml so I can only speculate.

One possibility is that it's treating a template rule such as

<xsl:template match="Full_Name">
        <xsl:apply-templates />
</xsl:template>

specially because it recognizes that it's identical to the built-in
template, and adding some text to the output kills this optimization. 

Just a conjecture. 14 seconds to process 2500 records does seem excessive.

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Jonathan Kart [mailto:jkart(_at_)aktitech(_dot_)com] 
Sent: 06 October 2004 00:47
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] csv slows down transform

Hi all,

I have 2 sample stylesheets to show you.  They are auto-generated, so 
please forgive the redundancy and other flaws.  My question is, what 
does the first stylesheet consistently run slower than the 
second.  For 
an xml doc of about 2500 'Contacts' this first sheet takes 
~14 seconds, 
the second less than 1 second.  I swear the only difference 
is that one 
inserts quotes and commas around the data while the other does not.  
It's not a trick question i promise.  The time difference is 
substantial.  We're using the php libxml extension in a web 
environment 
under windows 200 server, and iis.

Thanks for any help, this is boggling my itty-bitty mind.

SHEET 1
-----------
<xsl:stylesheet version="1.0" exclude-result-prefixes="dt" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:dt="http://xsltsl.org/date-time";>
      <xsl:import 
href="http://www.newdream.org/CMS/lib/xslsl/stdlib.xsl"; />
      <xsl:output method="xml" />
      <xsl:template match="text()">
              <xsl:value-of select="." 
disable-output-escaping="yes" />
      </xsl:template>
      <xsl:template match="*">
              <xsl:copy>
                      <xsl:apply-templates select="@*" />
                      <xsl:apply-templates select="node()" />
              </xsl:copy>
      </xsl:template>
      <xsl:template match="@*">
              <xsl:copy />
      </xsl:template>
      <xsl:template match="/">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="//region[(_at_)id=\'region93\']">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="assignment[(_at_)id=\'assignment\']">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="Contacts">
              <xsl:apply-templates select="Full_Name" />
              <xsl:apply-templates select="Activity_Points" />
              <xsl:text>
                      &#10;
              </xsl:text>
      </xsl:template>
      <xsl:template match="Full_Name">
              &quot;
              <xsl:apply-templates />
              &quot;,
      </xsl:template>
      <xsl:template match="Full_Name" mode="Normal">
              &quot;
              <xsl:apply-templates />
              &quot;,
      </xsl:template>
      <xsl:template match="Activity_Points">
              &quot;
              <xsl:apply-templates />
              &quot;,
      </xsl:template>
      <xsl:template match="Activity_Points" mode="Normal">
              &quot;
              <xsl:apply-templates />
              &quot;,
      </xsl:template>
</xsl:stylesheet>

SHEET 2 - same thing, but no &quot; no , and no &#10;
------------

<xsl:stylesheet version="1.0" exclude-result-prefixes="dt" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:dt="http://xsltsl.org/date-time";>
      <xsl:import 
href="http://www.newdream.org/CMS/lib/xslsl/stdlib.xsl"; />
      <xsl:output method="xml" />
      <xsl:template match="text()">
              <xsl:value-of select="." 
disable-output-escaping="yes" />
      </xsl:template>
      <xsl:template match="*">
              <xsl:copy>
                      <xsl:apply-templates select="@*" />
                      <xsl:apply-templates select="node()" />
              </xsl:copy>
      </xsl:template>
      <xsl:template match="@*">
              <xsl:copy />
      </xsl:template>
      <xsl:template match="/">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="//region[(_at_)id=\'region93\']">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="assignment[(_at_)id=\'assignment\']">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="Contacts">
              <xsl:apply-templates select="Full_Name" />
              <xsl:apply-templates select="Activity_Points" />
      </xsl:template>
      <xsl:template match="Full_Name">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="Full_Name" mode="Normal">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="Activity_Points">
              <xsl:apply-templates />
      </xsl:template>
      <xsl:template match="Activity_Points" mode="Normal">
              <xsl:apply-templates />
      </xsl:template>
</xsl:stylesheet>


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




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