[Lxml-checkins] r54076 - in lxml/trunk: . benchmark
scoder at codespeak.net
scoder at codespeak.net
Thu Apr 24 00:47:08 CEST 2008
Author: scoder
Date: Thu Apr 24 00:47:07 2008
New Revision: 54076
Modified:
lxml/trunk/ (props changed)
lxml/trunk/benchmark/bench_objectify.py
lxml/trunk/benchmark/benchbase.py
Log:
r4045 at delle: sbehnel | 2008-04-23 23:44:28 +0200
changed trees to a somewhat more realistic szenario with smaller XML vocabularies - absolute numbers are no longer comparable to previous benchmarks
Modified: lxml/trunk/benchmark/bench_objectify.py
==============================================================================
--- lxml/trunk/benchmark/bench_objectify.py (original)
+++ lxml/trunk/benchmark/bench_objectify.py Thu Apr 24 00:47:07 2008
@@ -46,14 +46,14 @@
def bench_attributes_deep(self, root):
"1 2 4"
for i in self.repeat3000:
- root.zzzzz['{cdefg}z00000']
+ root.zzzzz['{cdefg}a00001']
def bench_attributes_deep_cached(self, root):
"1 2 4"
cache1 = root.zzzzz
- cache2 = cache1['{cdefg}z00000']
+ cache2 = cache1['{cdefg}a00001']
for i in self.repeat3000:
- root.zzzzz['{cdefg}z00000']
+ root.zzzzz['{cdefg}a00001']
def bench_objectpath(self, root):
"1 2 4"
@@ -63,15 +63,15 @@
def bench_objectpath_deep(self, root):
"1 2 4"
- path = self.objectify.ObjectPath(".zzzzz.{cdefg}z00000")
+ path = self.objectify.ObjectPath(".zzzzz.{cdefg}a00001")
for i in self.repeat3000:
path(root)
def bench_objectpath_deep_cached(self, root):
"1 2 4"
cache1 = root.zzzzz
- cache2 = cache1['{cdefg}z00000']
- path = self.objectify.ObjectPath(".zzzzz.{cdefg}z00000")
+ cache2 = cache1['{cdefg}a00001']
+ path = self.objectify.ObjectPath(".zzzzz.{cdefg}a00001")
for i in self.repeat3000:
path(root)
Modified: lxml/trunk/benchmark/benchbase.py
==============================================================================
--- lxml/trunk/benchmark/benchbase.py (original)
+++ lxml/trunk/benchmark/benchbase.py Thu Apr 24 00:47:07 2008
@@ -199,8 +199,9 @@
el = SubElement(root, "{abc}"+ch1*5, attributes)
el.text = text
for ch2 in atoz:
+ tag = "{cdefg}%s00001" % ch2
for i in range(20 * TREE_FACTOR):
- SubElement(el, "{cdefg}%s%05d" % (ch2, i)).tail = text
+ SubElement(el, tag).tail = text
t = current_time() - t
return (root, t)
@@ -216,7 +217,7 @@
el = SubElement(root, "{abc}"+ch1*5, attributes)
el.text = text
for ch2 in atoz:
- SubElement(el, "{cdefg}%s%05d" % (ch2, i)).tail = text
+ SubElement(el, "{cdefg}%s00001" % ch2).tail = text
t = current_time() - t
return (root, t)
@@ -229,7 +230,7 @@
children = [root]
for i in range(6 + TREE_FACTOR):
tag_no = count().next
- children = [ SubElement(c, "{cdefg}a%05d" % i, attributes)
+ children = [ SubElement(c, "{cdefg}a%05d" % (i%8), attributes)
for i,c in enumerate(chain(children, children, children)) ]
for child in children:
child.text = text
More information about the lxml-checkins
mailing list