classification
Title: Use _PyArg_Parser for _PyArg_ParseStack(): support positional only arguments
Type: performance Stage:
Components: Interpreter Core Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: haypo, inada.naoki, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-02-05 10:09 by haypo, last changed 2017-02-05 10:39 by serhiy.storchaka.

Messages (2)
msg287043 - (view) Author: STINNER Victor (haypo) * (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.
History
Date User Action Args
2017-02-05 10:39:10serhiy.storchakasetmessages: + msg287045
2017-02-05 10:09:13haypocreate