From 96b7a5f04241820f7dc6e2226798459bee2b4235 Mon Sep 17 00:00:00 2001 From: An Long Date: Fri, 9 Sep 2022 17:52:30 +0800 Subject: [PATCH 1/3] Add jobs field in compile section to specify make -j param --- doc/benchmark.conf.sample | 3 +++ pyperformance/compile.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/benchmark.conf.sample b/doc/benchmark.conf.sample index ebf377e8..ea69746e 100644 --- a/doc/benchmark.conf.sample +++ b/doc/benchmark.conf.sample @@ -79,6 +79,9 @@ affinity = # disabled. upload = False +# Specify '-j' parameter in 'make' command +jobs = 8 + # Configuration to upload results to a Codespeed website [upload] diff --git a/pyperformance/compile.py b/pyperformance/compile.py index f8559224..91608206 100644 --- a/pyperformance/compile.py +++ b/pyperformance/compile.py @@ -298,11 +298,13 @@ def compile(self): configure = os.path.join(self.conf.repo_dir, 'configure') self.run(configure, *config_args) + argv = ['make'] if self.conf.pgo: # FIXME: use taskset (isolated CPUs) for PGO? - self.run('make', 'profile-opt') - else: - self.run('make') + argv.append('profile-opt') + if self.conf.jobs: + argv.append('-j%d' % self.conf.jobs) + self.run(*argv) def install_python(self): program, _ = resolve_python( @@ -778,6 +780,9 @@ def getboolean(section, key, default): except KeyError: return default + def getint(section, key, default): + return int(getstr(section, key, default)) + # [config] conf.json_dir = getfile('config', 'json_dir') conf.json_patch_dir = os.path.join(conf.json_dir, 'patch') @@ -796,6 +801,7 @@ def getboolean(section, key, default): conf.pgo = getboolean('compile', 'pgo', True) conf.install = getboolean('compile', 'install', True) conf.pkg_only = getstr('compile', 'pkg_only', '').split() + conf.jobs = getint('compile', 'jobs', 1) # [run_benchmark] conf.system_tune = getboolean('run_benchmark', 'system_tune', True) From aad9f6c22354c2a3da330a9e83b9602fae866b2d Mon Sep 17 00:00:00 2001 From: AN Long Date: Tue, 27 Sep 2022 15:04:31 +0800 Subject: [PATCH 2/3] Update pyperformance/compile.py Co-authored-by: Eric Snow --- pyperformance/compile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyperformance/compile.py b/pyperformance/compile.py index 91608206..fa7ababc 100644 --- a/pyperformance/compile.py +++ b/pyperformance/compile.py @@ -801,7 +801,10 @@ def getint(section, key, default): conf.pgo = getboolean('compile', 'pgo', True) conf.install = getboolean('compile', 'install', True) conf.pkg_only = getstr('compile', 'pkg_only', '').split() - conf.jobs = getint('compile', 'jobs', 1) + try: + conf.jobs = getint('compile', 'jobs') + except KeyError: + conf.jobs = None # [run_benchmark] conf.system_tune = getboolean('run_benchmark', 'system_tune', True) From 87138235d657b3fac68e9813b588ef35843f9460 Mon Sep 17 00:00:00 2001 From: AN Long Date: Tue, 27 Sep 2022 15:04:37 +0800 Subject: [PATCH 3/3] Update pyperformance/compile.py Co-authored-by: Eric Snow --- pyperformance/compile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyperformance/compile.py b/pyperformance/compile.py index fa7ababc..0a7c8332 100644 --- a/pyperformance/compile.py +++ b/pyperformance/compile.py @@ -780,7 +780,7 @@ def getboolean(section, key, default): except KeyError: return default - def getint(section, key, default): + def getint(section, key, default=None): return int(getstr(section, key, default)) # [config]