Re: [xslt] efficiency



On Thu, May 23, 2002 at 02:22:35AM -0400, Michael Rothwell wrote:
> I'm applying a 24k stylesheet to a 96k xml file. It takes about two seconds
> on a P3-700, with very high CPU usage.

  Sounds abnormally high.

> It seems like the apply-stylesheet time does not grow linearly with the size
> of the input -- it grows much more rapidly.
> 
> I would like to be able to process the XML in a smaller amount of time,
> because the reponsiveness of the web server (which is doing the transforms)
> suffers quite dramatically. I'm not sure how to achieve this, though.
> Smaller input is not really an option. Are there some general optimization
> strategies for stylesheets processed by liibxslt? Some known slow
> constructs? Gotchas?

  use --profile to see in which templates the time is spent. Like any
programming language XSLT can be made quite slow in just a couple of 
unwisely programmed lines. Understanding the cost of each operations
can take a lot of expertise because it's an high level language.

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]