Skip to content

socket.htons uses unnecessary METH_VARARGS #111662

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

Closed
wrongnull opened this issue Nov 2, 2023 · 4 comments
Closed

socket.htons uses unnecessary METH_VARARGS #111662

wrongnull opened this issue Nov 2, 2023 · 4 comments
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@wrongnull
Copy link
Contributor

wrongnull commented Nov 2, 2023

Feature or enhancement

Proposal:

By replacing calling convention to METH_O it will run faster

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@wrongnull wrongnull added the type-feature A feature request or enhancement label Nov 2, 2023
@Eclips4 Eclips4 added performance Performance or resource usage extension-modules C modules in the Modules dir and removed type-feature A feature request or enhancement labels Nov 2, 2023
@serhiy-storchaka
Copy link
Member

socket.ntohs() also can be optimized.

There is a larger patch in #64373 that converts the socket module to Argument Clinic. It would automatically apply such optimization for these functions and for many other.

@wrongnull
Copy link
Contributor Author

socket.ntohs() also can be optimized.

There is a larger patch in #64373 that converts the socket module to Argument Clinic. It would automatically apply such optimization for these functions and for many other.

The main idea of this issue is replacing calling convention to METH_O when needed. I think the clinic argument is optional here

@wrongnull
Copy link
Contributor Author

@serhiy-storchaka moreover, I don't think this patch is actual since there are now get_module_state function calls

@corona10
Copy link
Member

corona10 commented Nov 8, 2023

socket.ntohs() also can be optimized.
There is a larger patch in #64373 that converts the socket module to Argument > Clinic. It would automatically apply such optimization for these functions and for many other.

#111661 updated several methods to use AC tool instead of manual parsing.
If someone wants to update other things too, please open a new issue.

@corona10 corona10 closed this as completed Nov 8, 2023
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

4 participants