Re: [xslt] libxslt optimizations/performance



On Fri, Jan 31, 2003 at 12:33:57PM -0500, Gennady Feldman wrote:
> 
> While optimizing some of my XSL files I noticed that in some cases there
> is a performance difference where it shouldn't really be.
> 
> if you do something like:
>   <zzz>
>      <xsl:attribute name="id">
>             <xsl:value-of select="@id"/>
>      </xsl:attribute>
>   </zzz>
> 
> instead of:
>   <zzz id="{@id}"/>
> 
> then the first case is faster than the second case where logically it's
> the same thing (isn't it?).

  yes but you add the requirement to parse {@id}, and that is done
only at runtime, while the structure based version has more preprocessing
done at compile time. Attribute value templates are costly in libxslt.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]