[Checkins] SVN: z3c.pt/trunk/benchmark/benchmark/tests.py Improved lxml benchmark.

Malthe Borch mborch at gmail.com
Sun Aug 24 07:44:37 EDT 2008


Log message for revision 90168:
  Improved lxml benchmark.

Changed:
  U   z3c.pt/trunk/benchmark/benchmark/tests.py

-=-
Modified: z3c.pt/trunk/benchmark/benchmark/tests.py
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/tests.py	2008-08-24 11:12:53 UTC (rev 90167)
+++ z3c.pt/trunk/benchmark/benchmark/tests.py	2008-08-24 11:44:37 UTC (rev 90168)
@@ -36,17 +36,17 @@
 def bigtable_python_lxml(table=None):
     root = etree.Element("html")
     for r in table:
-        row = etree.Element("tr")
+        row = root.makeelement("tr")
         for c in r.values():
             d = c + 1
-            col = etree.Element("td")
-            span = etree.Element("span")
+            col = row.makeelement("td")
+            span = col.makeelement("span")
             span.attrib['class'] = 'column-%d' % d
             span.text = str(d)
             col.append(span)
             row.append(col)
         root.append(row)
-    return etree.tostring(root)
+    return etree.tostring(root, encoding='utf-8')
 
 class BaseTestCase(unittest.TestCase):
 



More information about the Checkins mailing list