python ElementTree xml: parsing fromstring vs building elements -
Given a large array of numbers where: [1, 2, 3 , 4 ...] = & gt; & Lt; Tag attrib = "1" /> & Lt; Tag attrib = "2" /> & Lt; Tag attrib = "3" /> & Lt; Tag attrib = "4" /> ... Which is more efficient / fast: a) Make them scratched using the element ("name", attributes) or b) from fromstring (str) where str is the string representation of those tags in the instance Update Test: to xml.etree.ElementTree import element, XML, tostring Elit: eroot ERR = Element ('Route') for .append (element ("tag", {"attrib": "antib"): time for import from time to time in estist = [xchange (1000) E for test_normal () Elit E for AIT test_list (): eroot = Element ('root') [eroot.append (element ("tag", {"attrib": "% s"% e})) ] Print "etree:% .6f"% timeit (test_normal, number = 1000) from xml.etree.cElementTree import el...