New submission from Serhiy Storchaka <[email protected]>:
This is a continuation of issue23867. The proposed PR makes Argument Clinic
inlining parsing code for functions with only positional parameters, i.e.
functions that use PyArg_ParseTuple() and _PyArg_ParseStack() now. This saves
time for parsing format strings and calling few levels of functions. It can
save also a C stack, because of lesser number of nested (and potentially
recursive) calls, lesser number of variables, and getting rid of a stack
allocated array for "objects" which will need to be deallocated or cleaned up
if overall parsing fails.
PyArg_ParseTuple() and _PyArg_ParseStack() will still be used if there are
parameters for which inlining converter is not supported. Unsupported
converters are deprecated Py_UNICODE API ("u", "Z"), encoded strings ("es",
"et"), obsolete string/bytes converters ("y", "s#", "z#"), some custom
converters (DWORD, HANDLE, pid_t, intptr_t).
----------
components: Argument Clinic
messages: 332510
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic: inline parsing code for functions with only positional
parameters
type: performance
versions: Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35582>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com