-
Notifications
You must be signed in to change notification settings - Fork 79
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just put it directly in the list, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well let's separate CPython specific variables :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can separate them with a comment and/or a newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM