Re: [xslt] FYI on string interning of XSLT transform mode/modeURI



On Tue, Mar 29, 2005 at 11:33:54AM -0800, Mark Vakoc wrote:
> Yeah, but it's worked pretty well in reducing the memory footprint in my
> application which uses xslt extensions to retrieve data (potentially lots) from
> various relational databases.  I will say that this takes significant knowledge
> of libxslt's handling of rvt's when designing the xslt, basically breaking
> things into many small templates so the rvt's get free'd more often.  
> 
> Which brings me to this question:  I've poked around trying to improve the
> granularity of the RVT's lifetime with little success, but I think one area
> that could work is RVT's created inside an <xsl:for-each> loop, i.e.
> 
> <xsl:for-each select="something">
>  <xsl:variable name="var" select="wow:some-extension-creating-rvts"/>
> </xsl:for-each>
> 
> The rvt created in the for each loop is place in the tmpRVT for the template,
> even though they aren't accessible outside the for-each loop.  Usually I'll
> have the for-each loop call a named template that retrieves and processes the
> external data.  This is not as pretty but reduces the overhead.  

  Hum, yes I see, yeah I would take patches for this :-)
Also Dodji pointed out the size of the result tree as being a big memory
use factor in libxslt, if you look at 
  http://xmlsoft.org/XSLT/html/libxslt-transform.html#xsltRunStylesheet
notice the 2 arguments:
  SAX: a SAX handler for progressive callback output (not implemented yet)
  IObuf: an output buffer for progressive output (not implemented yet)

  it had been that way forever but that's something, non trivial, but 
not much more difficult than dictionnaries, it would allow to output
to SAx or at least to an I/O front end directly without keeping the full
output tree around. I would estimate implementing this around a full week
of work, not that I really have time for this right now but it might be
a good candidate in the future if I'm bored.

Daniel

P.S. any news on the XML diff front ;-)

-- 
Daniel Veillard      | Red Hat Desktop team http://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]