Title: Use _PyArg_Parser for _PyArg_ParseStack(): support positional only arguments
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: methane, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2017-02-05 10:09 by vstinner, last changed 2018-09-19 23:12 by vstinner. This issue is now closed.

Messages (2)
msg287043 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-02-05 10:09
Serhiy Storshaka wrote a kind of cache for PyArg_ParseTupleAndKeywords(): _PyArg_Parser structure used by _PyArg_ParseTupleAndKeywordsFast(). It makes argument parser much faster.

Would it be possible to modify it to be able to use it in _PyArg_ParseStack(). (Would it be faster?)

See also issue #29419 "Argument Clinic: inline PyArg_UnpackTuple and PyArg_ParseStack(AndKeyword)?" for a different kind of optimization.
msg287045 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-02-05 10:39
I don't think it would be faster.

But it is possible to get rid of some code duplication at the cost of making it slower.
Date User Action Args
2018-09-19 23:12:40vstinnersetstatus: open -> closed
resolution: out of date
stage: resolved
2017-02-05 10:39:10serhiy.storchakasetmessages: + msg287045
2017-02-05 10:09:13vstinnercreate