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

2021-10-14 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

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

2021-10-14 Thread STINNER Victor
STINNER Victor added the comment: I decided to merge my PR to address https://bugs.python.org/issue45439 initial issue: "[C API] Move usage of **tp_vectorcall_offset** from public headers to the internal C API". Last years, I added `tstate` parameters to internal C functions. The agreement

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

2021-10-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3cc56c828d2d8f8659ea49447234bf0d2b87cd64 by Victor Stinner in branch 'main': bpo-45439: Move _PyObject_VectorcallTstate() to pycore_call.h (GH-28893) https://github.com/python/cpython/commit/3cc56c828d2d8f8659ea49447234bf0d2b87cd64 --

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

2021-10-13 Thread STINNER Victor
STINNER Victor 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 =>

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

2021-10-13 Thread STINNER Victor
STINNER Victor added the comment: I measured the stack consumption using attached sys_call.patch and stack_overflow-4.py. Using gcc -O3, the stack consumption with PR 28893 is *way better* on the 6 benchmarks (6 ways to call functions), especially: PyObject_CallOneArg(): 624 bytes/call => 5

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

2021-10-13 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50355/sys_call.patch ___ Python tracker ___ ___ Python-bugs-list mailing

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

2021-10-12 Thread STINNER Victor
STINNER Victor added the comment: 5 years ago, I added _PyObject_CallArg1() (similar to PyObject_CallOneArg()) and then I removed it since it consumed more stack memory than existing function, whereas I added _PyObject_CallArg1() to reduce the stack consumption. commit 7bfb42d5b7721ca26e3305

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

2021-10-12 Thread STINNER Victor
STINNER Victor added the comment: I should also check again the stack consumption. Old issues: * bpo-29465: Modify _PyObject_FastCall() to reduce stack consumption * bpo-29234: Disable inlining of _PyStack_AsTuple() to reduce the stack consumption * bpo-29227: Reduce C stack consumption in fu

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

2021-10-12 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50351/bench2.py ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2021-10-12 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50350/test_bench2.patch ___ Python tracker ___ ___ Python-bugs-list maili

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

2021-10-12 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50349/bench_no_args_public.py ___ Python tracker ___ ___ Python-bugs-list

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

2021-10-12 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50347/bench_no_args.patch ___ Python tracker ___ ___ Python-bugs-list mai

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

2021-10-12 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50348/bench_no_args_inline.py ___ Python tracker ___ ___ Python-bugs-list

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50346/bench.py ___ Python tracker ___ ___ Python-bugs-list mailing list U

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50345/test_bench.patch ___ Python tracker ___ ___ Python-bugs-list mailin

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

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset d943d19172aa93ce88bade15b9f23a0ce3bc72ff by Victor Stinner in branch 'main': bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895) https://github.com/python/cpython/commit/d943d19172aa93ce88bade15b9f23a0ce3bc72ff -- _

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27190 pull_request: https://github.com/python/cpython/pull/28895 ___ Python tracker ___ __

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27188 pull_request: https://github.com/python/cpython/pull/28893 ___ Python tracker ___ __

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

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset ce3489cfdb9f0e050bdc45ce5d3902c2577ea683 by Victor Stinner in branch 'main': bpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891) https://github.com/python/cpython/commit/ce3489cfdb9f0e050bdc45ce5d3902c2577ea683 ---

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27186 pull_request: https://github.com/python/cpython/pull/28891 ___ Python tracker ___ __

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

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset fb8f208a4ddb38eedee71f9ecd0f22058802dab1 by Victor Stinner in branch 'main': bpo-45439: _PyObject_Call() only checks tp_vectorcall_offset once (GH-28890) https://github.com/python/cpython/commit/fb8f208a4ddb38eedee71f9ecd0f22058802dab1 ---

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

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +27185 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28890 ___ Python tracker ___ _

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

2021-10-11 Thread STINNER Victor
New submission from STINNER Victor : The public C API should avoid accessing directly PyTypeObject members: see bpo-40170. I propose to move static inline functions to the internal C API, and only expose opaque function calls to the public C API. -- components: C API messages: 403695