Thanks Stefan,<br><br>It was taking 30 seconds, now taking 3!<br clear="all"><br clear="all"><br>Regards,<br>Joseph David Borġ <br><a href="http://www.jdborg.com" target="_blank">http://www.jdborg.com</a><br>
<br><br><div class="gmail_quote">On 13 June 2012 19:35, Stefan Behnel <span dir="ltr">&lt;<a href="mailto:stefan_ml@behnel.de" target="_blank">stefan_ml@behnel.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Joe Borġ, 13.06.2012 19:39:<br>
<div class="im">&gt; I&#39;m running a script with 2.7 that deals with some heavy XML files.  I&#39;m<br>
&gt; trying to speed it up best I can; using cProfile I&#39;ve seen what&#39;s taking<br>
&gt; all the time.  It&#39;s the function _get_elements_by_tagName_helper.  Can<br>
&gt; anyone tell me where this is called and if I can improve its runtime speed?<br>
<br>
</div>I assume you are using minidom? My (biased) advice would be to switch to<br>
lxml. It&#39;s substantially faster than mindom in basically all regards.<br>
Alternative, if that suits your needs, use the xml.etree.cElementTree<br>
package in the stdlib, which is also substantially faster but less capable.<br>
<br>
Stefan<br>
_______________________________________________<br>
xml-sig mailing list<br>
<a href="mailto:xml-sig@python.org">xml-sig@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/xml-sig" target="_blank">http://mail.python.org/mailman/listinfo/xml-sig</a><br>
</blockquote></div><br>