8000 Add jobs field in compile section to specify make -j param by aisk · Pull Request #236 · python/pyperformance · GitHub
[go: up one dir, main page]

Skip to content

Add jobs field in compile section to specify make -j param #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/benchmark.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
15 changes: 12 additions & 3 deletions pyperformance/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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')
Expand All @@ -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)
Expand Down
0