[xml-sig] _get_elements_by_tagName_helper taking resources

Joe Borġ mail at jdborg.com
Thu Jun 14 14:59:43 CEST 2012

Thanks Stefan,

It was taking 30 seconds, now taking 3!

Joseph David Borġ

On 13 June 2012 19:35, Stefan Behnel <stefan_ml at behnel.de> wrote:

> Joe Borġ, 13.06.2012 19:39:
> > I'm running a script with 2.7 that deals with some heavy XML files.  I'm
> > trying to speed it up best I can; using cProfile I've seen what's taking
> > all the time.  It's the function _get_elements_by_tagName_helper.  Can
> > anyone tell me where this is called and if I can improve its runtime
> speed?
> I assume you are using minidom? My (biased) advice would be to switch to
> lxml. It's substantially faster than mindom in basically all regards.
> Alternative, if that suits your needs, use the xml.etree.cElementTree
> package in the stdlib, which is also substantially faster but less capable.
> Stefan
> _______________________________________________
> xml-sig mailing list
> xml-sig at python.org
> http://mail.python.org/mailman/listinfo/xml-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/xml-sig/attachments/20120614/d4dcbf83/attachment.html>

More information about the xml-sig mailing list