summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorscoder <none@none>2007-09-27 22:22:18 +0200
committerscoder <none@none>2007-09-27 22:22:18 +0200
commit605dc74ae867e6a63b0411ea7c8149d5ff2cebf0 (patch)
tree3c0436bf107976ad2a36e6ae91f46d6e0574a48b /benchmark
parentfb1fc1547d5d788d76f54515191ffc2ffc1fcd9d (diff)
downloadpython-lxml-605dc74ae867e6a63b0411ea7c8149d5ff2cebf0.tar.gz
[svn r2933] iterfind() benchmarks, set_text() fix
--HG-- branch : trunk
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bench_etree.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmark/bench_etree.py b/benchmark/bench_etree.py
index f32329dc..a7ab92db 100644
--- a/benchmark/bench_etree.py
+++ b/benchmark/bench_etree.py
@@ -5,6 +5,9 @@ from StringIO import StringIO
import benchbase
from benchbase import with_attributes, with_text, onlylib, serialized, children
+TEXT = "some ASCII text"
+UTEXT = u"some klingon: \F8D2"
+
############################################################
# Benchmarks
############################################################
@@ -299,5 +302,17 @@ class BenchMark(benchbase.BenchMarkBase):
def bench_findall_tag(self, root):
root.findall(".//" + self.SEARCH_TAG)
+ @onlylib('lxe')
+ def bench_iterfind(self, root):
+ list(root.iterfind(".//*"))
+
+ @onlylib('lxe')
+ def bench_iterfind_tag(self, root):
+ list(root.iterfind(".//" + self.SEARCH_TAG))
+
+ @onlylib('lxe')
+ def bench_iterfind_islice(self, root):
+ list(islice(root.iterfind(".//*"), 10, 110))
+
if __name__ == '__main__':
benchbase.main(BenchMark)