Skip to content

gh-126204: Add a sys._jit_enabled helper - #126247

Closed
Eclips4 wants to merge 32 commits into
python:mainfrom
Eclips4:add-py-jit
Closed

gh-126204: Add a sys._jit_enabled helper#126247
Eclips4 wants to merge 32 commits into
python:mainfrom
Eclips4:add-py-jit

Conversation

@Eclips4

@Eclips4Eclips4 commented Oct 31, 2024

Copy link
Copy Markdown
Member

@Eclips4
Eclips4 marked this pull request as ready for review October 31, 2024 16:49

@zoobazooba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not convinced that pyconfig.h is the right home for this - it seems like just pulling it from sysconfig is sufficient.

I'd rather not take the changes in the PC/PCbuild directories if we don't have to.

Comment on lines -1785 to -1788
# Temporarily enable ignore_stderr=True to ignore warnings on JIT builds
# See gh-126255 for more information
self.check_all_configs("test_initconfig_api", config, preconfig,
api=API_ISOLATED, ignore_stderr=True)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

That's fun. Due to incorrect assumptions, where JIT is actually enabled or not, this hack is no longer needed. Just setting PYTHON_JIT=0 is enough here.

@Eclips4
Eclips4 marked this pull request as ready for review November 10, 2024 03:24
@Eclips4Eclips4 changed the title gh-126204: Add a Py_JIT_ENABLED variable to pyconfig.hgh-126204: Add a sys._jit_enabled helperNov 10, 2024
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/sysmodule.c Outdated
Eclips4and others added 2 commits November 10, 2024 17:26
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@Eclips4
Eclips4 requested a review from picnixzNovember 10, 2024 15:34
Comment threadDoc/whatsnew/3.14.rst Outdated
Comment threadDoc/library/sys.rst
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/sysmodule.c
Eclips4and others added 3 commits November 10, 2024 18:20
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/pylifecycle.c Outdated
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

@picnixzpicnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A final nitpick. And a question: is there a lot of

_PyOptimizerObject*optimizer=_Py_GetOptimizer();
if (optimizer!=NULL) {
Py_DECREF(optimizer);
...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

Comment threadPython/sysmodule.c Outdated
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@Eclips4

Copy link
Copy Markdown
MemberAuthor

A final nitpick. And a question: is there a lot of

_PyOptimizerObject*optimizer=_Py_GetOptimizer();
if (optimizer!=NULL) {
Py_DECREF(optimizer);
...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

In fact, there are only two uses of _Py_GetOptimizer. I'm not sure if we should remove this usage in this PR.

Comment threadPython/pylifecycle.c
@Eclips4
Eclips4 requested a review from zoobaNovember 13, 2024 20:56
@Eclips4

Copy link
Copy Markdown
MemberAuthor

Superseded by #129194

@Eclips4Eclips4 closed this Jan 30, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Eclips4@zooba@picnixz