mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-29735: Optimize partial_call(): avoid tuple (#516)
* Add _PyObject_HasFastCall() * partial_call() now avoids temporary tuple to pass positional arguments if the callable supports the FASTCALL calling convention for positional arguments. * Fix also a performance regression in partial_call() if the callable doesn't support FASTCALL.
This commit is contained in:
parent
d4914e9041
commit
0f7b0b397e
3 changed files with 105 additions and 40 deletions
|
@ -209,6 +209,10 @@ PyAPI_FUNC(int) _PyStack_UnpackDict(
|
|||
40 bytes on the stack. */
|
||||
#define _PY_FASTCALL_SMALL_STACK 5
|
||||
|
||||
/* Return 1 if callable supports FASTCALL calling convention for positional
|
||||
arguments: see _PyObject_FastCallDict() and _PyObject_FastCallKeywords() */
|
||||
PyAPI_FUNC(int) _PyObject_HasFastCall(PyObject *callable);
|
||||
|
||||
/* Call the callable object 'callable' with the "fast call" calling convention:
|
||||
args is a C array for positional arguments (nargs is the number of
|
||||
positional arguments), kwargs is a dictionary for keyword arguments.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue