"""
with temp_dir() as script_dir:
script = make_script(script_dir, "perftest", code)
+ env = {**os.environ, "PYTHON_JIT": "0"}
with subprocess.Popen(
[sys.executable, "-Xperf", script],
text=True,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
+ env=env,
) as process:
stdout, stderr = process.communicate()
"""
with temp_dir() as script_dir:
script = make_script(script_dir, "perftest", code)
+ env = {**os.environ, "PYTHON_JIT": "0"}
with subprocess.Popen(
[sys.executable, "-Xperf", script],
text=True,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
+ env=env,
) as process:
stdout, stderr = process.communicate()
"""
with temp_dir() as script_dir:
script = make_script(script_dir, "perftest", code)
+ env = {**os.environ, "PYTHON_JIT": "0"}
with subprocess.Popen(
[sys.executable, script],
text=True,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
+ env=env,
) as process:
stdout, stderr = process.communicate()
"-c",
'print("hello")',
)
+ env = {**os.environ, "PYTHON_JIT": "0"}
stdout = subprocess.check_output(
- cmd, cwd=script_dir, text=True, stderr=subprocess.STDOUT
+ cmd, cwd=script_dir, text=True, stderr=subprocess.STDOUT, env=env
)
except (subprocess.SubprocessError, OSError):
return False
def run_perf(cwd, *args, use_jit=False, **env_vars):
+ env = os.environ.copy()
if env_vars:
- env = os.environ.copy()
env.update(env_vars)
- else:
- env = None
+ env["PYTHON_JIT"] = "0"
output_file = cwd + "/perf_output.perf"
if not use_jit:
base_cmd = (
with temp_dir() as script_dir:
script = make_script(script_dir, "perftest", code)
+ env = {**os.environ, "PYTHON_JIT": "0"}
with subprocess.Popen(
[sys.executable, "-Xperf", script],
universal_newlines=True,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
+ env=env,
) as process:
stdout, stderr = process.communicate()