diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-11 01:07:03 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-11 01:07:03 +0100 |
commit | 3106ff9ad570b650a3afee6ebc4adc7430c5eca2 (patch) | |
tree | b78004bdbca2c0ece350acc0510e9fd5529ffccc /Objects | |
parent | 7ee4a773664fa60b93a008db32bb0e8609175215 (diff) | |
download | cpython-3106ff9ad570b650a3afee6ebc4adc7430c5eca2.tar.gz |
Disable _PyStack_AsTuple() inlining
Issue #29234: Inlining _PyStack_AsTuple() into callers increases their stack
consumption, Disable inlining to optimize the stack consumption.
Add _Py_NO_INLINE: use __attribute__((noinline)) of GCC and Clang.
It reduces the stack consumption, bytes per call, before => after:
test_python_call: 1040 => 976 (-64 B)
test_python_getitem: 976 => 912 (-64 B)
test_python_iterator: 1120 => 1056 (-64 B)
=> total: 3136 => 2944 (- 192 B)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 93bf87fa88..5726160c08 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2256,7 +2256,9 @@ PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs) return _Py_CheckFunctionResult(callable, result, NULL); } -PyObject* +/* Issue #29234: Inlining _PyStack_AsTuple() into callers increases their + stack consumption, Disable inlining to optimize the stack consumption. */ +PyObject* _Py_NO_INLINE _PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs) { PyObject *args; |