half-baked parsers vs binary XML

Matthew Sergeant (EML) Matthew.Sergeant at eml.ericsson.se
Mon Mar 29 10:55:09 BST 1999


> -----Original Message-----
> From:	Gabe Beged-Dov [SMTP:begeddov at jfinity.com]
> 
> Another reason (other than the binary XML thread) that I brought this up
> was discussion on
> the perl-xml mailing list of whether XML::Parser was usable for soft
> real-time server side
> processing. The consensus there seems to be no.
> 
	I think it's "Yes" - if you do it right.

> XML::Parser is layered on expat. Anecdotal evidence seems to be that there
> is an order of
> magnitude performance advantage to "parsing" something other than XML. The
> two alternatives
> are a textual format that Perl can eval directly (Data::Dumper) and a
> binary format
> (Storable).
> 
> In both cases (Data::Dumper and Storable) there is conversion from the
> on-disk format to the
> in-memory format. Why is XML so much slower according to developer
> feedback? That is what I
> was trying to understand from other peoples experience rather than doing a
> hands-on analysis
> myself.
> 
> I may have jumped to the conclusion that it was the extra work that a
> well-formedness
> processor has to do over what a half-baked processor would do. That still
> leaves the quesion
> of where the slowdown is and whether it is an implementation issue or
> inherent is some aspect
> of XML parsing.
> 
	I think the real problem is that you're doing 2 stages of work with
XML::Parser, as opposed to using Storable or Data::Dumper. With XML::Parser
I'm reading the XML and searching (querying) for specific nodes within the
XML. There's work there that has to be done in finding the nodes. If I could
just call parsefile() without any extra work I think it would be fast
enough. What I'm really doing, by using Storable is caching the parse+query
phase. That should really be considered standard practice for any high
performance system.

	Matt.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list