Skip to content

Commit bd48487

Browse files
authored
Add support for experimental JIT builds (#351)
1 parent a0cc449 commit bd48487

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

doc/benchmark.conf.sample

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ lto = True
3737
# Profiled Guided Optimization (PGO)?
3838
pgo = True
3939

40+
# Build the experimental just-in-time (JIT) compiler?
41+
# Possible values are:
42+
# - no: (default) do not build the JIT or the micro-op interpreter.
43+
# The new PYTHON_JIT environment variable has no effect.
44+
# - yes: build the JIT and enable it by default. PYTHON_JIT=0 can be used to
45+
# disable it at runtime.
46+
# - yes-off: build the JIT, but do not enable it by default. PYTHON_JIT=1 can
47+
# be used to enable it at runtime.
48+
# - interpreter: do not build the JIT, but do build and enable the micro-op
49+
# interpreter. This is useful for those of us who find ourselves developing
50+
# or debugging micro-ops (but don’t want to deal with the JIT).
51+
# PYTHON_JIT=0 can be used to disable the micro-op interpreter at runtime.
52+
jit = no
53+
4054
# The space-separated list of libraries that are package-only,
4155
# i.e., locally installed but not on header and library paths.
4256
# For each such library, determine the install path and add an

pyperformance/compile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ def compile(self):
291291
config_args.append('--with-pydebug')
292292
elif self.conf.lto:
293293
config_args.append('--with-lto')
294+
if self.conf.jit:
295+
config_args.append(f'--enable-experimental-jit={self.conf.jit}')
294296
if self.conf.pkg_only:
295297
config_args.extend(self.get_package_only_flags())
296298
if self.conf.debug:
@@ -801,6 +803,7 @@ def getint(section, key, default=None):
801803
conf.directory = getfile('compile', 'bench_dir')
802804
conf.lto = getboolean('compile', 'lto', True)
803805
conf.pgo = getboolean('compile', 'pgo', True)
806+
conf.jit = getstr('compile', 'jit', '')
804807
conf.install = getboolean('compile', 'install', True)
805808
conf.pkg_only = getstr('compile', 'pkg_only', '').split()
806809
try:

pyperformance/tests/test_commands.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def create_compile_config(self, *revisions,
228228
bench_dir = {outdir}
229229
lto = {not fast}
230230
pgo = {not fast}
231+
jit = no
231232
install = True
232233
233234
[run_benchmark]

0 commit comments

Comments
 (0)