Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
Hi,
In 2017, I added a new experimental FASTCALL calling convention. See my articles about it:The start of the FASTCALL project andFASTCALL microbenchmarks. It avoids the need to create a temporarytuple to pass positional arguments and the need to create a temporarydictionary to pass keyword arguments. I did my best to keep this API private. I added functions prefixed with_Py
:_PyObject_Fastcall()
. Cython is eager to always use the fastest code and quickly adopted this newMETH_FASTCALL
calling convention... oops, I forgot to add a_Py
prefix since theseMETH
constants don't start withPy
.
In 2019, this calling convention was extended to support also method calls (pass theself
argument):PEP 590 – Vectorcall: a fast calling protocol for CPython. This new API is public and standardized. For example, it added publicPyVectorcall_Function()
andPyObject_Vectorcall()
functions.
In 2023, the FASTCALL API is still around in the public C API:
- METH_FASTCALL
- _PyObject_FastCall()
- _PyObject_FastCallTstate()
- _PyObject_FastCallDict()
- _PyObject_FastCallDictTstate()
- _PyStack_AsDict()
- _PY_FASTCALL_SMALL_STACK
Can it be deprecated? Removed? I suppose that if we are in the unknown, the safe option is to start by deprecating it in Python 3.13 and plan its removal in Python 3.15.
cc@encukou
Victor
Linked PRs
- gh-106023: Update code using _PyObject_FastCall() #106257
- gh-106023: Remove _PY_FASTCALL_SMALL_STACK constant #106258
- gh-106023: Rename _PyObject_FastCallDictTstate() #106264
- gh-106023: Remove _PyObject_FastCall() function #106265
- gh-106023: Remove _PyObject_FastCallTstate() function #106273
- gh-106023: Update What's New in 3.13: _PyObject_FastCall() #117633
- Revert "gh-106023: Update What's New in 3.13: _PyObject_FastCall() (#117633)" #117676