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

[WIP] bpo-45490: Convert static inline to macros #29728

Closed
wants to merge 1 commit into from
Closed

[WIP] bpo-45490: Convert static inline to macros #29728

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 23, 2021

Convert static inline functions to macros to run a benchmark:

  • PyObject_TypeCheck()
  • PyType_Check()
  • PyType_CheckExact()
  • PyType_HasFeature()
  • PyVectorcall_NARGS()
  • Py_DECREF()
  • Py_INCREF()
  • Py_IS_TYPE()
  • Py_NewRef()
  • Py_REFCNT()
  • Py_SIZE()
  • Py_TYPE()
  • Py_XDECREF()
  • Py_XINCREF()

Note: Py_XNewRef() remains a static inline function.

https://bugs.python.org/issue45490

@vstinner
Copy link
Member Author

PR created to run benchmarks comparing static inline functions and macros for the PEP 670: https://www.python.org/dev/peps/pep-0670/

Convert static inline functions to macros to run a benchmark:

* PyObject_TypeCheck()
* PyType_Check()
* PyType_CheckExact()
* PyType_HasFeature()
* PyVectorcall_NARGS()
* Py_DECREF()
* Py_INCREF()
* Py_IS_TYPE()
* Py_NewRef()
* Py_REFCNT()
* Py_SIZE()
* Py_TYPE()
* Py_XDECREF()
* Py_XINCREF()

Note: Py_XNewRef() remains a static inline function.
@vstinner
Copy link
Member Author

"Check if generated files are up to date" CI test failed with:

Some extra declarations were found in "Include/Python.h" with Py_LIMITED_API:
 - _PyDebug_PrintTotalRefs

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Dec 24, 2021
@vstinner vstinner closed this Feb 23, 2022
@vstinner vstinner deleted the bench_macro branch February 23, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review DO-NOT-MERGE stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants