New submission from STINNER Victor: Attached patch avoids the creation of a temporary tuple in method_call() and slot_tp_new() by using the new fast call calling convention.
It uses a small buffer allocated on the stack C if the function is called with 4 arguments or less, or it allocates a buffer in the heap memory. The function also avoids INCREF/DECREF: references are borrowed, not strong references. The patch adds a private _PyObject_Call_Preprend() helper function written to optimize such way of packing positional arguments, it's like: args = (obj,) + args func(*args, **kw) ---------- files: call_prepend.patch keywords: patch messages: 273461 nosy: haypo, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Use fast call in method_call() and slot_tp_new() type: performance versions: Python 3.6 Added file: http://bugs.python.org/file44200/call_prepend.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27841> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com