Skip to content

Fast versions of C functions #418

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

Open
cjdoris opened this issue Nov 7, 2023 · 0 comments
Open

Fast versions of C functions #418

cjdoris opened this issue Nov 7, 2023 · 0 comments
Milestone

Comments

@cjdoris
Copy link
Collaborator

cjdoris commented Nov 7, 2023

We can avoid calling C functions in some common cases as an optimisation.

e.g. Py_IncRef_Fast can just increment the refcount.

e.g. Py_DecRef_Fast can just decrement the refcount provided it is >1.

e.g. PyObject_IsInstance_Fast can check if the type is exactly the same for a fast positive. Can use the type flags to get some fast negatives when one side is a builtin type.

@cjdoris cjdoris added this to the features milestone Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant