diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-03-14 20:37:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-14 20:37:20 (GMT) |
commit | 0f7b0b397e12514ee213bc727c9939b66585cbe2 (patch) | |
tree | 786e7994f6128c4cba34a9d20c7d9aa5a96ba566 /Include | |
parent | d4914e9041cb9455592facba2a1afa6d905f1c01 (diff) | |
download | cpython-0f7b0b397e12514ee213bc727c9939b66585cbe2.zip cpython-0f7b0b397e12514ee213bc727c9939b66585cbe2.tar.gz cpython-0f7b0b397e12514ee213bc727c9939b66585cbe2.tar.bz2 |
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.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/abstract.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 03e2f02..cd963af 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -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. |