[pypy-commit] benchmarks default: fixes
arigo
noreply at buildbot.pypy.org
Wed Dec 10 10:26:59 CET 2014
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r293:24b6c21ba3f0
Date: 2014-12-10 09:27 +0000
http://bitbucket.org/pypy/benchmarks/changeset/24b6c21ba3f0/
Log: fixes
diff --git a/own/bm_icbd.py b/own/bm_icbd.py
--- a/own/bm_icbd.py
+++ b/own/bm_icbd.py
@@ -3,26 +3,33 @@
def main(n):
# HAAAAAACK with subprocess because I can't get the thing
- # to run in-process :-( As a result, it doesn't make
- # sense to run it more than once.
-
- d = os.environ.copy()
- d['PYTHONPATH'] = 'icbd'
- t0 = time.time()
- popen = subprocess.Popen(
- [sys.executable,
- '-m', 'icbd.type_analyzer.analyze_all',
- '-I', 'stdlib/python2.5_tiny',
- '-I', '.',
- '-E', 'icbd/type_analyzer/tests',
- '-E', 'icbd/compiler/benchmarks',
- '-E', 'icbd/compiler/tests',
- '-I', 'stdlib/type_mocks',
- '-n',
- 'icbd'], cwd=this_dir, env=d, stdout=subprocess.PIPE)
- popen.communicate()
- time_elapsed = time.time() - t0
- return [time_elapsed] * n
+ # to run in-process :-( As a result, it doesn't make much
+ # sense to run it more than once. We'll run it n/25 times,
+ # like hexiom2. All runs suffer from warm-up.
+ l = []
+ for i in range(n):
+ if (i % 25) == 0:
+ d = os.environ.copy()
+ d['PYTHONPATH'] = 'icbd'
+ t0 = time.time()
+ popen = subprocess.Popen(
+ [sys.executable,
+ '-m', 'icbd.type_analyzer.analyze_all',
+ '-I', 'stdlib/python2.5_tiny',
+ '-I', '.',
+ '-E', 'icbd/type_analyzer/tests',
+ '-E', 'icbd/compiler/benchmarks',
+ '-E', 'icbd/compiler/tests',
+ '-I', 'stdlib/type_mocks',
+ '-n',
+ 'icbd'],
+ cwd=this_dir, env=d, stdout=subprocess.PIPE)
+ popen.communicate()
+ if popen.returncode != 0:
+ raise OSError("the subprocess failed, see above")
+ time_elapsed = time.time() - t0
+ l.append(time_elapsed)
+ return l
if __name__ == "__main__":
import util, optparse
More information about the pypy-commit
mailing list