Re: Performance question

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

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
    <xsl:call-template name="start_row">
      <xsl:param name="depth"><xsl:number level="single" count="/data/*"

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>

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

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

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.


 XSL-List info and archive:

Current Thread