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

gh-85283: Build _statistics extension with the limited C API #116927

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 17, 2024

Argument Clinic now inlines _PyArg_CheckPositional() for the limited C API. The generated code should be as fast or even a little bit faster.

@vstinner
Copy link
Member Author

I made a previous attempt last August: PR gh-108500. It made _statistics._normal_dist_inv_cdf() 2x slower because of the usage of the legacy METH_VARARGS calling convention, instead of more recent and faster METH_FASTCALL.

This new attempt keeps METH_FASTCALL thanks to recent Argument Clinic changes, and so it has no impact on performance. Or maybe it's a little bit faster thanks to inlining.

cc @serhiy-storchaka @erlend-aasland

Argument Clinic now inlines _PyArg_CheckPositional() for the limited
C API. The generated code should be as fast or even a little bit
faster.
@vstinner vstinner force-pushed the limited_statistics branch from cf0beee to 3c5728e Compare March 17, 2024 16:27
@vstinner vstinner merged commit 2982bdb into python:main Mar 17, 2024
37 of 38 checks passed
@vstinner vstinner deleted the limited_statistics branch March 17, 2024 17:59
vstinner added a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
…ython#116927)

Argument Clinic now inlines _PyArg_CheckPositional() for the limited
C API. The generated code should be as fast or even a little bit
faster.
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…ython#116927)

Argument Clinic now inlines _PyArg_CheckPositional() for the limited
C API. The generated code should be as fast or even a little bit
faster.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…ython#116927)

Argument Clinic now inlines _PyArg_CheckPositional() for the limited
C API. The generated code should be as fast or even a little bit
faster.
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.

2 participants