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
bpo-45295: Speed up C classmethod calls via unbound classmethods #28572
base: main
Are you sure you want to change the base?
bpo-45295: Speed up C classmethod calls via unbound classmethods #28572
Conversation
|
I've cancelled the workflows temporarily to save resources. |
|
Pinging @markshannon as I think this may interest you. Not sure who else to ping for descriptor stuff, maybe the original |
|
Knowing my luck with benchmarks, pyperformance showed no change :(. The current code allows for improving Python classmethods too. After implementing that I will try running this against the Pyston benchmark suite instead (pyperformance almost doesnt use any classmethods). If that too doesnt show any speedups i will just abandon this PR. |
|
What are you trying to speed up here? Could you provide an example? |
All builtin classmethod calls. So |


_PyObject_GetMethodnow supports C classmethods.PyClassMethodDescr_Typenow supports vectorcall.This PR has two changes because supporting vectorcall made it easier to call unbound cclassmethods. Without vectorcall, I'd need to write a lot of custom code.
Moving to vectorcall also means we can get rid of the old calling code :).
Microbench on Windows Release, pyperformance coming later (once tests pass):
This is without specialization support. That will come in another PR.
https://bugs.python.org/issue45295