Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C API: What's the status of the half-private FASTCALL calling convention? #106023

Closed
Labels
@vstinner

Description

@vstinner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp