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..0a7c8332 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=None): + 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,10 @@ 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() + try: + conf.jobs = getint('compile', 'jobs') + except KeyError: + conf.jobs = None # [run_benchmark] conf.system_tune = getboolean('run_benchmark', 'system_tune', True)