Re: Re: Bundling libxml2 and expat compatibility layer
| From: | Sterling Hughes | Date: | Sun, 04 May 2003 16:36:34 +0000 |
| Subject: | Re: Re: Bundling libxml2 and expat compatibility layer | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1224@lists.php.net to get a copy of this message | ||
> Ok. If you think I compare apples and oranges, well. Suppose I do.
> But take a look what's finally offered by domxml. It's a verified tree
> of nodes that were resulted from parsing original xml.
> Nothing more nothing less.
Yes, a whole lot more. Look at the features at
http://www.xmlsoft.org/. I'm not arguing this point
anymore, just
because you don't know libxml internals, doesn't mean it doesn't support
an efficient SAX interface. Again, look at the Push parser interface.
Look at the independent benchmarks.
> I think everybody clearly understand advantages of having such trees.
> I'm actually not against it. It should be quite clear thought.
>
> Now about the matter of discussing.
> It's performance. When I set proper callbacks for expat I get the same node
> tree in 5 times faster.
expat doesn't support building a node tree. If you build a specialized
node tree with expat, than sure it will be faster. But this isn't the
point. The point is you are comparing two different interfaces, SAX and
DOM. Expat only supports SAX, libxml2 supports SAX and DOM. Please
compare apples with apples and benchmark the libxml2 SAX interface (push
parser) interface, if you don't believe me.
> What this "good" domxml parser spends MY time for ?
> Answer is very simple. Have a look at parser.c shipped with libxml2.
> It's what I'd call geeze. It's written from scratches as if we are in 19th
> century.
> Ok Sterling if you think this approach is ok for all, why don't switch back
> to the same parser for PHP ?
> Let's introduce PHP 2.0 once again :))), geeze.
>
Uhh. Again, look at the benchmarks online, when it comes to building a
DOM tree libxml2 is the fastest available (besides msxml). But we're
not talking about DOM here, we're talking about SAX. Libxml is not only
a DOM library, its a complete library for processing XML. It supports
DOM, but it also supports SAX.
> What I'd love to see is Flex-based lexer for xml that has proven its really
> good performance.
>
Uhh, flex, while easier to write, would be slower in this case.
-Sterling
XML Benchmarks: http://xmlbench.sourceforge.net/