[Python-checkins] benchmarks: Skip slow benchmarks (hexiom2) in fast mode except when explicitly selected.
antoine.pitrou
python-checkins at python.org
Fri Oct 12 15:09:05 CEST 2012
http://hg.python.org/benchmarks/rev/670759f365c4
changeset: 187:670759f365c4
user: Antoine Pitrou <solipsis at pitrou.net>
date: Fri Oct 12 15:07:25 2012 +0200
summary:
Skip slow benchmarks (hexiom2) in fast mode except when explicitly selected.
files:
perf.py | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/perf.py b/perf.py
--- a/perf.py
+++ b/perf.py
@@ -2112,6 +2112,8 @@
"py3k": ["2to3", "2n3", "chameleon", "mako_v2"]
}
+SLOW_BENCHMARKS = ["hexiom2"]
+
def _ExpandBenchmarkName(bm_name, bench_groups):
"""Recursively expand name benchmark names.
@@ -2131,7 +2133,7 @@
yield bm_name
-def ParseBenchmarksOption(benchmarks_opt, bench_groups):
+def ParseBenchmarksOption(benchmarks_opt, bench_groups, fast=False):
"""Parses and verifies the --benchmarks option.
Args:
@@ -2164,6 +2166,14 @@
logging.warning("No benchmark named %s", bm)
else:
should_run.remove(bm)
+ if fast:
+ # In fast mode, skip slow benchmarks that weren't explicitly selected
+ # on the command line.
+ to_skip = (should_run - positive_benchmarks) & set(SLOW_BENCHMARKS)
+ if to_skip:
+ logging.info("Skipping slow benchmarks (%s) in fast mode",
+ ', '.join(sorted(to_skip)))
+ should_run = should_run - to_skip
return should_run
@@ -2321,7 +2331,8 @@
if options.diff_instrumentation:
info("Suppressing performance data due to --diff_instrumentation")
- should_run = ParseBenchmarksOption(options.benchmarks, bench_groups)
+ should_run = ParseBenchmarksOption(options.benchmarks, bench_groups,
+ options.fast)
results = []
for name in sorted(should_run):
--
Repository URL: http://hg.python.org/benchmarks
More information about the Python-checkins
mailing list