Skip to content
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

Merged
merged 8 commits into from
May 13, 2024

Conversation

@corona10 corona10 requested review from mdboom and vstinner May 11, 2024 10:43
@corona10
Copy link
Member Author

cc @tonybaloney

@corona10
Copy link
Member Author

@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"])
Copy link
Member

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?

Copy link
Member Author

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 :)

Copy link
Member

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.

Copy link
Member Author

@corona10 corona10 May 12, 2024

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

pyperf/_utils.py Outdated Show resolved Hide resolved
@corona10 corona10 requested a review from vstinner May 12, 2024 10:30
@vstinner
Copy link
Member

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.

@corona10
Copy link
Member Author

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.

@corona10 corona10 requested a review from vstinner May 13, 2024 03:52
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@corona10 corona10 merged commit 127e0bd into psf:main May 13, 2024
12 checks passed
@corona10 corona10 deleted the gh-187 branch May 13, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants