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

Re: Performance question

Subject: Re: Performance question
From: "Larry Mason" <Larry_Mason@xxxxxx>
Date: Mon, 21 Jun 1999 13:44:16 -0500
larry mason

A big thanks to James on determining the performance bottleneck.  Here is a
recap and resolution.

The XSL invokes a template to set the background color for each HTML table row.
The XML data has 2283 rows.  The template has one parameter, an indication of
the row's position, in order to determine if it is an evenly numbered row or
not.  Odd numbered rows are given one color and even numbered another.

Given this calculation of computing the parameter, the time to process was 9.1
seconds.
    <xsl:call-template name="start_row">
      <xsl:param name="depth"><xsl:number level="single" count="/data/*"
format="1"/>
   </xsl:param>

Given this calculation, the time is 3.3
    <xsl:call-template name="start_row">
      <xsl:param name="depth"><xsl:value-of select="position()"/></xsl:param>
   </xsl:param>

The tempalte itself:
  <xsl:template name="start_row">
    <xsl:param-variable name="depth">2</xsl:param-variable>
          <xsl:choose>
            <xsl:when test="$depth mod 2">
              <TR bgcolor="{$my_stripe_even}"/>
            </xsl:when>
            <xsl:otherwise>
              <TR bgcolor="{$my_stripe_odd}"/>
            </xsl:otherwise>
          </xsl:choose>
  </xsl:template>

Bear in mind lots of other XSL processing is occuring, this is simply showing
the difference between 2 methods of
producing a value for the parameter and the corresponding delta in processing
time.

According to James the degradation is due to xsl-number.  By using another
approach that yields the same value,
the performance issue has been resolved.

Thought I'd share this find with others who may have similar needs.

Regards,
Larry



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


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.