Re: efficiency
by Michel Rodriguez other posts by this author
Feb 24 2006 8:54AM messages near this date
view in the new Beta List Site
Re: efficiency
|
Re: SAX vs. DOM efficiency
& XSLT Martin J. Evans wrote:
> On 24-Feb-2006 Michel Rodriguez wrote:
>
> >Thomas, Mark - BLS CTR wrote:
> >
> >>You've only mentioned DOM modules. For speed on large files, the
> >>conventional wisdom is to use a SAX parser. Have you tried any of those?
> >
> >Except that conventional wisdom doesn't seem to be backed by figures:
> >
> >look at http://www.xmltwig.com/article/simple_benchmark/ especially the
> >figures for the last set of tests. It looks that at least in Perl, SAX
> >is rather slow, at least much slower than using straight XML::LibXML.
>
>
> It is late Friday at the end of a long week so I could be missing something
> here I think Mark was pointing to using SAX as a method rather than DOM. You can
> use a SAX parser to create a DOM i.e. parse the XML with a SAX parser into a
> DOM and store the entire document in memory, process it and output the results
> you want. Or, you can process you document little by little with a SAX parser
> and code you insert into the SAX event handlers - this does not require the
> entire document to be in memory. For speed, the latter is often much faster.
Do you have any evidence that "the latter (SAX) is often much faster"?
The point of my post was to mention that in my experience it is not. At
least in Perl, what you gain from SAX is lower memory usage and
conveniency to build filter chains, using XML::SAX::Machines for
example, but, as far as I can tell, no speed gain.
--
Michel Rodriguez
Perl & XML
xmltwig.com
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Andrew Strader
Andrew Strader
Mark - BLS CTR Thomas
Andrew Strader
Andrew Strader
Michel Rodriguez
A. Pagaltzis
Mark - BLS CTR Thomas
Michel Rodriguez
Mark - BLS CTR Thomas
Michel Rodriguez
A. Pagaltzis
Martin J. Evans
Michel Rodriguez
Barrie Slaymaker
Mark - BLS CTR Thomas
Barrie Slaymaker
Tod Harter
Michel Rodriguez
A. Pagaltzis
Tod Harter
Michel Rodriguez
Barrie Slaymaker
Bruce Miller
|