[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset f23fa1f7b68f by Victor Stinner in branch 'default': Issue #29465: Add Objects/call.c file https://hg.python.org/cpython/rev/f23fa1f7b68f -- ___ Python tracker

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset e9807e307f1f561a2dfe3e9f97a38444528dba86 by Victor Stinner in branch 'master': Fix PyCFunction_Call() performance issue https://github.com/python/cpython/commit/e9807e307f1f561a2dfe3e9f97a38444528dba86 --

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 31342913fb1e by Victor Stinner in branch 'default': Fix PyCFunction_Call() performance issue https://hg.python.org/cpython/rev/31342913fb1e -- nosy: +python-dev ___ Python tracker

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-08 Thread STINNER Victor
STINNER Victor added the comment: Crap, pyobject_fastcall-5.patch was not rebased correctly :-/ Please see pyobject_fastcall-6.patch instead. -- Added file: http://bugs.python.org/file46600/pyobject_fastcall-6.patch ___ Python tracker

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-08 Thread STINNER Victor
STINNER Victor added the comment: I splitted my big patch into smaller changes, see my pull request: https://github.com/python/cpython/pull/74 If you prefer Rietveld ([Review] button), I also attached the squashed change: pyobject_fastcall-5.patch. -- Added file:

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-08 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +25 ___ Python tracker ___ ___

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: pyobject_fastcall-4.patch combines a lot of changes. I wrote it to experiment _PyObject_FastCall(). I will rewrite these changes as a patch serie with smaller changes. The design of PyObject_FastCall*() is to be short and simple. Changes: * Add

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > Isn't the Python directory more appropriate place for call.c? I moved code from other .c files in Objects/, so for me it seems more natural to add the code in Objects/ as well. It seems like most of the code in Python/ is

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Awesome! This looks fantastic! I need to check the patch very carefully to be sure that we haven't missed something important. Isn't the Python directory more appropriate place for call.c? -- stage: -> patch review

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: Oh, with pyobject_fastcall-4.patch, the stack usage of test_python_iterator is even better. The reference is 1056 bytes/call, pyobject_fastcall-2.patch was 944 bytes/call. haypo@smithers$ ./python ../default/stack_overflow_28870-sp.py test_python_call:

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: Ok, I fixed the PyObject_Call() bug, and tried a new approach to help the compiler for code placement: I moved all "call" functions into a new Objects/call.c file. It should help the compiler to inline more code, and I move functions which call themself

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: Oh, pyobject_fastcall-3.patch contains a performance bug :-p PyObject_Call() "unpacks" the tuple and then recreates a new tuple to call functions in for functions other than Python and C functions. -- ___ Python

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor
STINNER Victor added the comment: Benchmarks result. Some are slower (code placement issue?), the faster benchmark are not really much faster. haypo@speed-python$ python3 -m perf compare_to /home/haypo/benchmarks/2017-02-06_07-15-default-e06af4027546.json

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-06 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot to rebase my local git branch: patch version 2 contains unrelated changes. Please see instead the path version 3 which was rebased. -- Added file: http://bugs.python.org/file46554/pyobject_fastcall-3.patch

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-06 Thread STINNER Victor
STINNER Victor added the comment: pyobject_fastcall-2.patch: More complete changes. Sorry, the patch also contains unrelated refactoring! It's a more advanced implementation which tries to reduce the depth of the C backtrace. For example, _PyObject_FastCall() is now inlined manually in

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-06 Thread STINNER Victor
STINNER Victor added the comment: meth_fastcall_stacksize.patch: Patch adding _testcapi.meth_fastcall_stacksize() to measure the stack usage to call a METH_FASTCALL function. -- Added file: http://bugs.python.org/file46546/meth_fastcall_stacksize.patch

[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-06 Thread STINNER Victor
New submission from STINNER Victor: While testing issue #29464 patch, I failed to see a major enhancement on the stack usage of fast calls without keyword arguments. The problem is that functions like _PyObject_FastCallKeywords() and _PyObject_FastCallDict() still have to pass a NULL argument