Skip to content

bpo-38644: Add _PyObject_Call() #17089

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

Merged
merged 1 commit into from
Nov 14, 2019
Merged

bpo-38644: Add _PyObject_Call() #17089

merged 1 commit into from
Nov 14, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 8, 2019

  • Add _PyObject_Call(): PyObject_Call() with tstate
  • Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
  • Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
    with tstate
  • _PyObject_Call_Prepend() now takes tstate
  • Replace _PyObject_FastCall() calls
    with _PyObject_VectorcallTstate() calls

https://bugs.python.org/issue38644

@vstinner
Copy link
Member Author

cc @markshannon @ericsnowcurrently

* Add pycore_call.h internal header file.
* Add _PyObject_Call(): PyObject_Call() with tstate
* Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
* Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
  with tstate
* _PyObject_Call_Prepend() now takes tstate
* Replace _PyObject_FastCall() calls
  with _PyObject_VectorcallTstate() calls
@vstinner
Copy link
Member Author

I rebased my PR to fix a conflict on Objects/call.c.

"Pass the Python thread state to internal C functions" thread on python-dev list confirmed that tstate is a performance bottleneck to scale Python on N CPUs: https://mail.python.org/archives/list/[email protected]/thread/PQBGECVGVYFTVDLBYURLCXA3T7IPEHHO/ So I will merge my PR once the CI pass.

@vstinner vstinner merged commit 4d231bc into python:master Nov 14, 2019
@vstinner vstinner deleted the call_tstate3 branch November 14, 2019 12:36
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
* Add pycore_call.h internal header file.
* Add _PyObject_Call(): PyObject_Call() with tstate
* Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
* Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
  with tstate
* _PyObject_Call_Prepend() now takes tstate
* Replace _PyObject_FastCall() calls
  with _PyObject_VectorcallTstate() calls
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
* Add pycore_call.h internal header file.
* Add _PyObject_Call(): PyObject_Call() with tstate
* Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
* Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
  with tstate
* _PyObject_Call_Prepend() now takes tstate
* Replace _PyObject_FastCall() calls
  with _PyObject_VectorcallTstate() calls
Sign up for free to 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