diff options
author | scoder <none@none> | 2008-01-25 18:21:55 +0100 |
---|---|---|
committer | scoder <none@none> | 2008-01-25 18:21:55 +0100 |
commit | 09fc057a7dd5472e3bde417f747943b661e41ccf (patch) | |
tree | 565869239ea225e80cbc4bf3d2350f118bf610d2 /benchmark | |
parent | ade22854c1c84d91a86617267c7625ada0416001 (diff) | |
download | python-lxml-09fc057a7dd5472e3bde417f747943b661e41ccf.tar.gz |
[svn r3204] r3322@delle: sbehnel | 2008-01-25 18:21:09 +0100
benchmark to compare findall() and xpath()
--HG--
branch : trunk
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/bench_etree.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/benchmark/bench_etree.py b/benchmark/bench_etree.py index b7e9b2e8..24a2851c 100644 --- a/benchmark/bench_etree.py +++ b/benchmark/bench_etree.py @@ -312,6 +312,12 @@ class BenchMark(benchbase.BenchMarkBase): root.findall(".//*[%s]/./%s/./*" % (self.SEARCH_TAG, self.SEARCH_TAG)) @onlylib('lxe') + def bench_xpath_path(self, root): + ns, tag = self.SEARCH_TAG[1:].split('}') + root.xpath(".//*[p:%s]/./p:%s/./*" % (tag,tag), + namespaces = {'p':ns}) + + @onlylib('lxe') def bench_iterfind(self, root): list(root.iterfind(".//*")) |