gh-187: Support environment variables PYTHON_GIL / PYTHON_CPU_COUNT#188
gh-187: Support environment variables PYTHON_GIL / PYTHON_CPU_COUNT#188
Conversation
corona10
commented
May 11, 2024
- https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHON_CPU_COUNT
- https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHON_GIL
|
cc @tonybaloney |
|
@hugovk PTAL for this PR too :) |
pyperf/_utils.py
Outdated
| copy_env = ["PATH", "HOME", "TEMP", "COMSPEC", "SystemRoot", "SystemDrive"] | ||
| # TODO: In the future, maybe we should manage CPython environment variables | ||
| # depending on the Python version. | ||
| copy_env.extend(["PYTHONPATH", "PYTHON_CPU_COUNT", "PYTHON_GIL"]) |
There was a problem hiding this comment.
Just put it directly in the list, no?
There was a problem hiding this comment.
Well let's separate CPython specific variables :)
There was a problem hiding this comment.
You can separate them with a comment and/or a newline.
There was a problem hiding this comment.
Well, I am not sure why you want to maintain the single list declaration even though this is not a performance-sensitive code
|
Remark: If clearing env vars is a surprising/bad default behavior for end users, we can also just remove it? I did it to make benchmarks easier to reproduce. |
I think that the propagation is the more precise way. I prefer to support it as same as currently. |