modperl_xml_dom_xpath_etc

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: DeWitt Clinton <dewitt@avacet.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: [OT] XML::DOM
Date: Tue, 23 Jan 2001 12:55:52 +0000 (GMT)

On Tue, 23 Jan 2001, DeWitt Clinton wrote:

> On Tue, Jan 23, 2001 at 10:06:13AM +0000, Matt Sergeant wrote:
>
> > The only gain might be in a large DOM tree where there may be
> > thousands of objects. But then you're really better off using an
> > array based class instead (as I found out).
>
> This is getting a bit off-topic, but I'm empirically found that the
> DOM is not necessarily the best object model to use in a mod_perl
> environment.  XML::DOM in particular has such a high overhead in terms
> of memory (and memory leaks) and performance, that it is sometimes
> inappropriate for a context that requires a small footprint, and
> generally fast throughput (like mod_perl).

I could have told you that for free :-)

However its not all doom and gloom - XML::XPath implements the DOM API,
and doesn't leak memory, and might be faster, and is certainly under more
active development...

But if performance is absolutely key in XML parsing/processing, then you
really need to be looking towards Orchard, which we're co-developing with
Ken MacLeod (author of the PerlSAX bindings and XML::Grove). Current tests
reveal that its about 10 times faster at parsing than any Perl tree based
parser and XPath resolution is about 6 times faster than current
XML::XPath and XML::XQL. Plus it garbage collects automatically (and
unlike Perl, really, truly, actually frees up its memory).

===
To: modperl@apache.org
From: "Paul J. Lucas" <pauljlucas@mac.com>
Subject: Re: [OT] XML::DOM
Date: Tue, 23 Jan 2001 11:15:44 -0800 (PST)

On Tue, 23 Jan 2001, Matt Sergeant wrote:

> But if performance is absolutely key in XML parsing/processing, then you
> really need to be looking towards Orchard, which we're co-developing with
> Ken MacLeod (author of the PerlSAX bindings and XML::Grove). Current tests
> reveal that its about 10 times faster at parsing than any Perl tree based
> parser ...

	FYI, I recently released my of XML::Tree.  My benchmark tests
	against XML::Parser show mine to be 12 times faster.  I wrote it
	as sort of a challenge (internal to my company).  The code is
	based on my similar HTML::Tree.

	A current caveat of mine is that it's not a compliant parser.
	It doesn't currently handle Unicode, CDATA sections, ELEMENT
	declarations, and probably some other stuff.  But, if you're
	processing straight-forward XML files, like config files, it
	certainly works, and fast.

		http://homepage.mac.com/pauljlucas/software/xml_tree/

===
To: "Paul J. Lucas" <pauljlucas@mac.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: [OT] XML::DOM
Date: Tue, 23 Jan 2001 20:45:23 +0000 (GMT)

On Tue, 23 Jan 2001, Paul J. Lucas wrote:

> On Tue, 23 Jan 2001, Matt Sergeant wrote:
> 
> > But if performance is absolutely key in XML parsing/processing, then you
> > really need to be looking towards Orchard, which we're co-developing with
> > Ken MacLeod (author of the PerlSAX bindings and XML::Grove). Current tests
> > reveal that its about 10 times faster at parsing than any Perl tree based
> > parser ...
> 
> 	FYI, I recently released my of XML::Tree.  My benchmark tests
> 	against XML::Parser show mine to be 12 times faster.  I wrote it
> 	as sort of a challenge (internal to my company).  The code is
> 	based on my similar HTML::Tree.
> 
> 	A current caveat of mine is that it's not a compliant parser.
> 	It doesn't currently handle Unicode, CDATA sections, ELEMENT
> 	declarations, and probably some other stuff.  But, if you're
> 	processing straight-forward XML files, like config files, it
> 	certainly works, and fast.
> 
> 		http://homepage.mac.com/pauljlucas/software/xml_tree/

Aside from categorically *not* being an XML parser (if it doesn't parse
XML 1.0 files then its not officially an XML parser), it doesn't compile
on my stock Mandrake 7.0 laptop:

make[1]: Entering directory `/tmp/XML_Tree-1.0/mod/XML/Tree'
g++ -c -I../../.. -Dbool=char -DHAS_BOOL -I/usr/local/include
-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
-mpentium -mcpu=pentium -march=pentium -ffast-math
-fexpensive-optimizations
-DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fpic
-I/usr/lib/perl5/5.00503/i386-linux/CORE -Ubool Tree.c
Tree.xs: In function `void XS_XML_Node_att(CV *)': 
Tree.xs:196: taking dynamic typeid of object with -fno-rtti
Tree.xs:196: confused by earlier errors, bailing out

===

To: modperl@apache.org
From: "Paul J. Lucas" <pauljlucas@mac.com>
Subject: Re: [OT] XML::DOM
Date: Tue, 23 Jan 2001 13:16:01 -0800 (PST)

On Tue, 23 Jan 2001, Matt Sergeant wrote:

> Aside from categorically *not* being an XML parser (if it doesn't parse
> XML 1.0 files then its not officially an XML parser)

	Whatever.  It's still 12 times faster at parsing files that
	look very much like XML in a majority of real-world cases.
	(There: happy?)  Also, as I stated, is is just version 1.0.

> it doesn't compile on my stock Mandrake 7.0 laptop:
> 
> make[1]: Entering directory `/tmp/XML_Tree-1.0/mod/XML/Tree'
> g++ -c -I../../.. -Dbool=char -DHAS_BOOL -I/usr/local/include
> -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
> -mpentium -mcpu=pentium -march=pentium -ffast-math
> -fexpensive-optimizations
> -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fpic
> -I/usr/lib/perl5/5.00503/i386-linux/CORE -Ubool Tree.c
> Tree.xs: In function `void XS_XML_Node_att(CV *)': 
> Tree.xs:196: taking dynamic typeid of object with -fno-rtti
> Tree.xs:196: confused by earlier errors, bailing out

	Your installation is outdated or broken or both: it should not
	be adding -fno-rtti.  It's certainly not in the distributed
	makefiles.

	It requires an ANSI C++ compiler (supporting RTTI).  If it
	doesn't compile ANSI C++ then it's not officially an ANSI C++
	compiler.

===

To: "Paul J. Lucas" <pauljlucas@mac.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: [OT] XML::DOM
Date: Tue, 23 Jan 2001 22:26:18 +0000 (GMT)

On Tue, 23 Jan 2001, Paul J. Lucas wrote:

> On Tue, 23 Jan 2001, Matt Sergeant wrote:
> 
> > it doesn't compile on my stock Mandrake 7.0 laptop:
> > 
> > make[1]: Entering directory `/tmp/XML_Tree-1.0/mod/XML/Tree'
> > g++ -c -I../../.. -Dbool=char -DHAS_BOOL -I/usr/local/include
> > -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
> > -mpentium -mcpu=pentium -march=pentium -ffast-math
> > -fexpensive-optimizations
> > -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fpic
> > -I/usr/lib/perl5/5.00503/i386-linux/CORE -Ubool Tree.c
> > Tree.xs: In function `void XS_XML_Node_att(CV *)': 
> > Tree.xs:196: taking dynamic typeid of object with -fno-rtti
> > Tree.xs:196: confused by earlier errors, bailing out
> 
> 	Your installation is outdated or broken or both: it should not
> 	be adding -fno-rtti.  It's certainly not in the distributed
> 	makefiles.
> 
> 	It requires an ANSI C++ compiler (supporting RTTI).  If it
> 	doesn't compile ANSI C++ then it's not officially an ANSI C++
> 	compiler.

>From your INSTALL file:

> XML Tree has the following software as prerequisites:
> 
> 1. A C++ compiler.  XML Tree has been built using g++ 2.95 (earlier
> versions are untested).
> 
> 2. A version of STL, the ANSI/ISO C++ Standard Template Library.  If you
> are using g++ or egcs, then you also need (the matching version
> of) libstd++.

$  gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)

$ rpm -q libstdc++
libstdc++-2.95.2-3mdk
$ rpm -q libstdc++-devel
libstdc++-devel-2.95.2-3mdk

Its perl adding the -fno-rtti, FWIW, not your Makefiles.

===
To: modperl@apache.org
From: "Paul J. Lucas" <pauljlucas@mac.com>
Subject: Re: [OT] XML::DOM
Date: Tue, 23 Jan 2001 14:49:44 -0800 (PST)

On Tue, 23 Jan 2001, Matt Sergeant wrote:

> Its perl adding the -fno-rtti, FWIW, not your Makefiles.

	Then there's something odd about your Perl installation.  Perl
	shouldn't be giving the option.  How does Perl "know" whether
	RTTI is needed or not?

	- Paul

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu