Re: [xml] libxml2 review in windows::developer
- From: Stefan Seefeld <seefeld sympatico ca>
- To: xml gnome org
- Subject: Re: [xml] libxml2 review in windows::developer
- Date: Fri, 11 Apr 2003 09:24:54 -0400
Hi Daniel, Peter,
Daniel Veillard wrote:
On Fri, Apr 11, 2003 at 12:49:27PM +0200, Peter Jacobi wrote:
void read_file(char const *input_name, FILE *output)
{
using xmlpp::DomParser;
using xmlpp::Node;
using xmlpp::Attribute;
DomParser parser(input_name);
Node *root = parser.get_root_node();
Node::NodeList children = root->children("entry");
you see, for me it's very hard to map that to the associated calls
in libxml2, I can't even tell where the document is actually parsed,
nor what root->children("entry"); actually does, is taht a call to XPath ?
or a direct walk of the children nodes, or ...
Node::NodeList::const_iterator begin = children.begin();
Node::NodeList::const_iterator end = children.end();
for(int i = 0; begin != end; ++begin, ++i)
{
Node const *node = *begin;
Attribute const *year = node->attribute("year");
Attribute const *month = node->attribute("month");
Attribute const *day = node->attribute("day");
Attribute const *who = node->attribute("who");
Entry entry(year->value(),
month->value(),
day->value(),
who->value());
I can think of ways to significantly speed up attribute value
lookup in the general case too..
ATM I'm working on features, maybe I will have time to do some
speedup work before the summer..
Apparently the libxml++ version used here is an old one which didn't
really wrap libxml2, but instead used libxml2 for the streaming of the
data only, i.e. all data access and manipulation was based on C++
container types, not on xmlNode !
A couple of weeks ago I committed a patch that changed libxml++'s
implementation dramatically, such that it is now a true wrapper, i.e.
using the _private pointers of xmlNode to bind the libxml2 nodes to
C++ wrapper objects. This implementation is a true wrapper as all
operations such as navigation through the DOM as well as the DOM's
manipulation fall back to libxml2 calls.
In other words, the performance tested above isn't telling you much
about libxml2. Apparently the author didn't care enough or at least
didn't do his homework to at least tell his audience what he was really
testing. Too bad...
Regards,
Stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]