Re: [xsl] how to estimate speed of a transformation

Subject: Re: [xsl] how to estimate speed of a transformation
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 11 Dec 2003 09:42:14 GMT


  <xsl:template name="footer">
    <xsl:variable name="doctitle" select="/book/descendant::title[1]"/>

  the programmer should expect that the computation takes place only once.
  Moreover, if it takes the form 

I seem to remember discussion on this list before now whereby some
systems will evaluate that no times (if the variable isn't used) or just
once, or each time it is referenced, depending on heurstics trying to
trade off cost of computation against cost of storing teh result.
One of the advantages of a side effect free langage is that you have
the choice of recalculating rather than storing.

  one should have the right to expect that for each n the computation is performed
  once, and if a template is called with the same value of 'n' repeatedly, it does not
  spend time on computing doctitle again.

The system doesn't have to re-calculate; it could cache the values so if
it sees the same n again, simply re-use it.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


Current Thread