[libxml-devel] Better performance from find or parsing?
Aaron Patterson
aaron at tenderlovemaking.com
Tue Feb 10 11:36:40 EST 2009
On Tue, Feb 10, 2009 at 06:45:26AM -0800, Trans wrote:
> Say I have about 20 tags to find in a document and manipulate. What is
> going to be the faster approach, reading through the entire tree and
> handling the matching tags as it comes across them, or doing a #find
> on the document for each tag.
I think it depends on the size of the document. I've found that there
is a certain point (around 8MB or so IIRC) where doing SAX parsing
becomes cheaper than a DOM + XPath search.
I guess it also depends on the searches you're doing.
I'm not being very helpful! My answer is "it depends". :-(
--
Aaron Patterson
http://tenderlovemaking.com/
More information about the libxml-devel
mailing list