[Lxml-checkins] r38417 - lxml/trunk/benchmark
scoder at codespeak.net
scoder at codespeak.net
Sat Feb 10 22:26:01 CET 2007
Author: scoder
Date: Sat Feb 10 22:25:59 2007
New Revision: 38417
Modified:
lxml/trunk/benchmark/benchbase.py
Log:
support regexps in benchmark selection
Modified: lxml/trunk/benchmark/benchbase.py
==============================================================================
--- lxml/trunk/benchmark/benchbase.py (original)
+++ lxml/trunk/benchmark/benchbase.py Sat Feb 10 22:25:59 2007
@@ -1,4 +1,4 @@
-import sys, string, time, copy, gc
+import sys, re, string, time, copy, gc
from itertools import *
from StringIO import StringIO
import time
@@ -305,10 +305,12 @@
# sorted by name and tree tuple
benchmarks = [ sorted(b.benchmarks()) for b in benchmark_suites ]
+ selected = [ re.compile(r).search for r in selected ]
+
if selected:
benchmarks = [ [ b for b in bs
if [ match for match in selected
- if match in b[0] ] ]
+ if match(b[0]) ] ]
for bs in benchmarks ]
return (benchmark_suites, benchmarks)
More information about the lxml-checkins
mailing list