[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

STINNER Victor report at bugs.python.org
Wed Oct 13 18:37:51 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

Using LTO, the PR 28893 *increases* the stack memory usage. It's the opposite :-)


PyObject_CallOneArg(): 672 bytes/call => 688 bytes/call (+16 bytes)
PyObject_CallNoArg(): 640 bytes/call => 672 bytes/call (+32 bytes)
_PyObject_CallNoArg(): 640 bytes/call => 672 bytes/call (+32 bytes)


clang with LTO:

    ./configure --with-lto CC=clang LD=lld LDFLAGS="-fuse-ld=lld"
    make

=== ref ===

$ ./python stack_overflow-4.py
test_python_call: 9187 calls before crash, stack: 912 bytes/call
test_python_getitem: 15868 calls before crash, stack: 528 bytes/call
test_python_iterator: 11901 calls before crash, stack: 704 bytes/call
test_callonearg: 12468 calls before crash, stack: 672 bytes/call
test_callnoargs: 13091 calls before crash, stack: 640 bytes/call
test_callnoargs_inline: 13092 calls before crash, stack: 640 bytes/call

=> total: 75607 calls, 4096 bytes

=== PR ===

$ ./python stack_overflow-4.py
test_python_call: 9186 calls before crash, stack: 912 bytes/call
test_python_getitem: 15400 calls before crash, stack: 544 bytes/call
test_python_iterator: 11384 calls before crash, stack: 736 bytes/call
test_callonearg: 12177 calls before crash, stack: 688 bytes/call
test_callnoargs: 12468 calls before crash, stack: 672 bytes/call
test_callnoargs_inline: 12467 calls before crash, stack: 672 bytes/call

=> total: 73082 calls, 4224 bytes

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45439>
_______________________________________


More information about the Python-bugs-list mailing list