Re: [xml] Performance of DOM interface



On Sat, Aug 24, 2002 at 03:13:08PM +0200, wellnhofer aevum de wrote:
Hi,

I'm using libxml and libxslt with Perl to generate dynamic HTML pages 
and did some performance testing recently. I created a XML tree from a 
Perl data structure using the DOM interface and transform that tree with 
XSLT.

While the performance of the XSLT transformation is really good, I found 
that constructing the DOM tree took about 75% of the running time. So it 
takes about three times longer to create the XML source tree than to 
parse a stylesheet and apply and output the transformation.

Is this behavior normal? I would think creating an XML tree is much 
faster than a XSLT transformation.

  Well usually when creating the input tree using directly the C parser,
the parse time (which includes building the DOM tree) is quite smaller than
the tranformation time itself. So no it's not "normal", though it also 
depends a lot on the stylesheet used too. You're probably paying the cost
of going back and forth between the Perl and the C library for each call 
to DOM entry points.

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]