[MOBY-l] XML::DOM

Jason E. Stewart jason at openinformatics.com
Fri Feb 8 20:29:42 UTC 2002


Hey All,

I noticed that the Perl modules in CVS where using XML::DOM. I don't
intend to start an advocacy war, but I've used that module for quite
some time, and I now avoid it. For XML of any moderate size it is way
too slow and way too memory intensive (i.e. a 15Mb XML file took 600Mb
of memory to completely load the DOM into memory).

I now use XML::Xerces whenever I need DOM access, it's implemented in
C++ under the hood, and is much faster, and has a much smaller
footprint. 

Beyond that, though. I avoid DOM whenever possible. The MAGE-ML files
we see tend to be really big, > 200Mb, and that is just unreasonable
for DOM. With SAX, it's not an issue. Also for creation of XML
documents I used to build a DOM structure in memory and then serialize
the DOM to a stream. When I converted my DOM building code to just
build and internal data structure and then write tags directly to the
stream, I got a two-order of magnitued increase in speed over whath
XML::DOM was giving me.

HTH,
jas.




More information about the moby-l mailing list