[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT with DOM or SAX ?

  • To: Chris Burdess <dog@b...>, Michael Kay <mike@s...>
  • Subject: Re: XSLT with DOM or SAX ?
  • From: Mukul Gandhi <mukul_gandhi@y...>
  • Date: Mon, 28 Mar 2005 01:25:35 -0800 (PST)
  • Cc: xml-dev@l..., 'Razvan MIHAIU' <mihaiu@m...>
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=D0YZiZy7QdcHK/ZwFC1/hq2i4jccNugWyCE2vZGHld5SGuP3xjDk8tyX/Zw1HuO4DXxC09mQigo/tkJgSZkqc1cnI1We2Ym1wsnbwpAYm/q2pexQJhMkU/aEF3SGqXOJg3syVZM9A+VgXNyNSTGjc89heejvQg9xXvQjxMnrzSQ= ;
  • In-reply-to: 6667

xslt sax
I did a small performance comparison between Xalan-J
2.6.0 and Saxon 8.3 . I ran a simple identity
transform on a small XML file. 

The XSLT is -

<?xml version="1.0"?> 
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
 
<xsl:output method="xml" indent="yes" /> 

<xsl:template match="@* | node()">
  <xsl:copy>
   <xsl:apply-templates select="@* | node()" />
  </xsl:copy> 
</xsl:template>
 
</xsl:stylesheet>


Average execution time recorded were:
-------------------------------------
Xalan-J 2.6.0 : 
with -DIAG option 220 ms

Saxon 8.3 : 
with -TP option 47 ms(Saxon's performance analysis
tool)
with -t option 63 ms

It seems Saxon is faster than Xalan. It seems upto
about 4-5 times.. I am assuming both Xalan and Saxon
are measuring the same things!

If "GNU JAXP XSLT processor" is 2.8 times faster than
Xalan , then Saxon is approximately 2 times faster
than GNU XSLT processor ..

I read in an article by Michael Kay that Saxon uses an
efficient tree structure suited for XPath data model..
DOM and XPath tree models don't map 100%. But I am not
sure what Xalan uses.. I guess it is DOM or a slight
variant of it..

Regards,
Mukul

--- Chris Burdess <dog@b...> wrote:
> Michael Kay wrote:
> >> What kind of parser is best to use for XSLT
> transformations ?
> >> SAX or DOM
> >
> > XSLT processors will in general build a tree
> representation of the 
> > source
> > document in memory. And in general, many of them
> will build a tree
> > representation that is much more efficient than
> using a 
> > general-purpose DOM.
> > So there's no point building an inefficient DOM
> tree rather than 
> > letting the
> > XSLT processor build its own. But this advice may
> depend on the XSLT
> > processor you are using.
> 
> For what it's worth, the GNU JAXP XSLT processor
> uses DOM internally 
> for both source and result trees, and is about 2.8
> times as fast as 
> Xalan on a wide range of transformations (the OASIS
> XSLT/XPath 
> conformance suite). I don't have figures for memory
> usage or 
> comparisons with Saxon though.
> -- 
> Chris Burdess
> 
> 
>
-----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at
> http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the
> subscription
> manager:
> <http://www.oasis-open.org/mlmanage/index.php>
> 
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more. 
http://info.mail.yahoo.com/mail_250

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.