Really interesting.  Sounds like a raw bug somewhere?  I won't have time to
trace this in the next week at least, but perhaps one of the other
developers can?

If I were to guess I would suspect a bug in the redundent expression
elimination code.  But I really don't know.

This should definitely be posted on bugzilla.

-scott




                                                                                       
                                                
                      John Gentilin                                                    
                                                
                      <gentijo@eyecatch        To:       xalan 
<[EMAIL PROTECTED]>                                              
                      ing.com>                 cc:       (bcc: Scott 
Boag/Cambridge/IBM)                                               
                                               Subject:  Strange performance issue     
                                                
                      09/12/2002 08:51                                                 
                                                
                      PM                                                               
                                                
                      Please respond to                                                
                                                
                      xalan-dev                                                        
                                                
                                                                                       
                                                
                                                                                       
                                                




I have this stylesheet that makes about 30 different database
queries and produces about 3000 lines of XSL code, which
in the end produces a 4-5 page tabular data form. For each cell I
have a template that allows you to format the cell data, an example
is:

<xsl:template match="col[@mode='simple" >
  <xsl:param name="data"/>
  <xsl:variable name="colMap" select="./@colMap"/>
  <xsl:variable name="val" select="$data/col[@column-label=$colMap]"/>
  <fo:block>
    <xsl:value-of select="$val"/>
  </fo:block>
</xsl:template>

now if I replace that template with the following

<xsl:template match="col[@mode='simple]" >
  <xsl:param name="data"/>
  <xsl:variable name="colMap" select="./@colMap"/>
  <fo:block>
    <xsl:value-of select="$data/col[@column-label=$colMap]"/>
  </fo:block>
</xsl:template>

the whole stylesheet is processed 2X faster, a difference from 4 sec
to 2.1 sec. I just ca't see why, there is just as many XPath statements
and they are just as complex. It is not the variable assignment because
the following template is only marginally slower.

<xsl:template match="col[@mode='simple]" >
  <xsl:param name="data"/>
  <xsl:variable name="colMap" select="./@colMap"/>
  <xsl:variable name="val" select="$data"/>
  <fo:block>
    <xsl:value-of select="$data/col[@column-label=$colMap]"/>
  </fo:block>
</xsl:template>

This template is called the most times, ~500, but it is also not the
only
template and there is a ton of DB activity besides. I can see a minor
speed
difference but to affect the processing time by half, the performance
penalty
must be incredible


TIA
John G







Reply via email to