bpo-36974: separate vectorcall functions for each calling convention#13781
bpo-36974: separate vectorcall functions for each calling convention#13781encukou merged 4 commits intopython:masterfrom
Conversation
|
Thank you! This will not go into beta1 (we're asked to not push last-minute changes). |
Why? It's an implementation detail that doesn't affect any public API or behavior. Apart from that, do you accept this PR for merging (at least for 3.9)? |
It does change functionality. See the GDB plugin – there are other tools like it that aren't tested in CPython's test suite.
I haven't reviewed it yet, but yes, it looks good at first glance. |
If so, I'll do the analogous change for |
|
Have you benchmarked this change? |
Using https://github.com/jdemeyer/callbench: Before: After: So this is clearly an improvement. |
116d4b2 to
8d6661f
Compare
|
Rebased to latest master. |
|
CC @methane |
b7ebda2 to
0f3206a
Compare
|
Rebased to latest master. |
|
Two issues with the code:
I made these changes, so I sent a PR to your branch. I didn't yet have time |
|
Petr: what's your opinion in general about this PR? Suppose that I merge your changes and polish them, would you then be willing to merge this? I'm asking because other potential reviewers may disagree with your changes. |
|
Yes, I'm willing to merge this (though I might take longer than some other reviewers). |
|
I made some further fixes and cleanups regarding to Petr's version:
|
1160ae1 to
800b8a8
Compare
|
Rebased to latest master, fixing trivial merge conflict. |
|
Thanks! |
|
Thank you! |
|
See #14782 for a backport to 3.8 |
Implement an optimization which is mentioned in PEP 590: use a specific vectorcall function for each calling convention (
METH_O,METH_FASTCALLand so on) to replace the generic_PyCFunction_Vectorcall.This allows getting rid of
_PyMethodDef_RawFastCallKeywordsin Python 3.9 (we should keep it in 3.8 since Cython uses it).CC @encukou @markshannon
https://bugs.python.org/issue36974