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

bpo-38644: Add _PyObject_Call() #17089

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 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 vstinner added the skip news label Nov 8, 2019
@vstinner vstinner force-pushed the vstinner:call_tstate3 branch from 39a995c to e764fd0 Nov 12, 2019
@vstinner vstinner requested a review from python/windows-team as a code owner Nov 12, 2019
@vstinner vstinner force-pushed the vstinner:call_tstate3 branch 2 times, most recently from 5a85cc0 to 296edd3 Nov 12, 2019
@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Nov 12, 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
@vstinner vstinner force-pushed the vstinner:call_tstate3 branch from 296edd3 to 08a1dab Nov 14, 2019
@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Nov 14, 2019

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/python-dev@python.org/thread/PQBGECVGVYFTVDLBYURLCXA3T7IPEHHO/ So I will merge my PR once the CI pass.

@vstinner vstinner merged commit 4d231bc into python:master Nov 14, 2019
4 checks passed
4 checks passed
Azure Pipelines PR #20191114.23 succeeded with issues
Details
bedevere/issue-number Issue number 38644 found
Details
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner vstinner deleted the vstinner:call_tstate3 branch Nov 14, 2019
jacksonriley added a commit to jacksonriley/cpython that referenced this pull request Nov 18, 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
jacobneiltaylor added 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.