This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Vectorcall implementation should conform to PEP 590.
Type: Stage:
Components: Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Mark.Shannon, jkloth, petr.viktorin, vstinner
Priority: normal Keywords: 3.9regression

Created on 2020-03-16 14:09 by Mark.Shannon, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg364325 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2020-03-16 14:09
The implementation of `PyObject_Vectorcall` adds unnecessary overhead to PEP 590, which undermines its purpose.
The implementation was changed in https://github.com/python/cpython/pull/17052, which I objected to at the time.

The change has a negative impact on performance as it add calls to both 
`PyThreadState_GET()` and `_Py_CheckFunctionResult()`.

This is practically an invitation for callers to skip `PyObject_Vectorcall` and access the underlying function pointer directly, making `PyObject_Vectorcall` pointless.

https://github.com/python/cpython/pull/17052 should be reverted.
msg364331 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-16 15:14
> The change has a negative impact on performance

How did you notice the slowdown? I ran benchmarks in https://github.com/python/cpython/pull/17052 and I didn't notice any performance overhead.
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84159
2020-03-16 15:14:03vstinnersetmessages: + msg364331
2020-03-16 14:27:01jklothsetnosy: + jkloth
2020-03-16 14:09:28Mark.Shannoncreate