bpo-45295: Speed up C classmethod calls via unbound classmethods#28572
bpo-45295: Speed up C classmethod calls via unbound classmethods#28572Fidget-Spinner wants to merge 6 commits into
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