diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-11 00:07:40 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-11 00:07:40 +0100 |
commit | 434723f94cfc27079f5ae91600c8baf384db334e (patch) | |
tree | c39d5fdaedb6218a90ce14b17865c59cedaf6bb3 /Include/abstract.h | |
parent | Issue #29217: Merge 3.6. (diff) | |
download | cpython-434723f94cfc27079f5ae91600c8baf384db334e.tar.gz cpython-434723f94cfc27079f5ae91600c8baf384db334e.tar.bz2 cpython-434723f94cfc27079f5ae91600c8baf384db334e.zip |
call_method() now uses _PyObject_FastCall()
Issue #29233: Replace the inefficient _PyObject_VaCallFunctionObjArgs() with
_PyObject_FastCall() in call_method() and call_maybe().
Only a few functions call call_method() and call it with a fixed number of
arguments. Avoid the complex and expensive _PyObject_VaCallFunctionObjArgs()
function, replace it with an array allocated on the stack with the exact number
of argumlents.
It reduces the stack consumption, bytes per call, before => after:
test_python_call: 1168 => 1152 (-16 B)
test_python_getitem: 1344 => 1008 (-336 B)
test_python_iterator: 1568 => 1232 (-336 B)
Remove the _PyObject_VaCallFunctionObjArgs() function which became useless.
Rename it to object_vacall() and make it private.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r-- | Include/abstract.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index f7d7dcc1da3..3ca283aa12a 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -323,14 +323,6 @@ PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable, ...); -#ifndef Py_LIMITED_API -/* Similar PyObject_CallFunctionObjArgs(), but pass positional arguments - as a va_list: list of PyObject* object. */ -PyAPI_FUNC(PyObject *) _PyObject_VaCallFunctionObjArgs( - PyObject *callable, - va_list vargs); -#endif - /* Call the method named 'name' of object 'obj' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by NULL. |