Why is xml.dom.minidom so slow?

David Mertz mertz at gnosis.cx
Thu Jan 2 17:14:20 EST 2003


"Fredrik Lundh" <fredrik at pythonware.com> wrote previously:
|as a general rule, XML toolkits that try to implement the DOM
|specification in pure Python are incredibly slow and bloated.
|toolkits that use a more pythonic api also tend to be more efficient;
|    http://effbot.org/zone/element-index.htm

I would also, perhaps, recommend my [gnosis.xml.objectify] module.  It
creates "Pythonic" objects based on XML documents.  If you use it, be
sure to use the EXPAT parser, rather than going through DOM (which is
the default, but it only takes one argument to use EXPAT).

I don't have a precise timing, but certainly much faster than DOM.  My
goal with the module was not really speed, but rather obtaining a more
natural Python interface.  Nonetheless, it goes pretty fast.

Take a look at <http://gnosis.cx/download/Gnosis_Utils-current.tar.gz>.

Yours, David...

--
mertz@  | The specter of free information is haunting the `Net!  All the
gnosis  | powers of IP- and crypto-tyranny have entered into an unholy
.cx     | alliance...ideas have nothing to lose but their chains.  Unite
        | against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------






More information about the Python-list mailing list