classification
Title: Convert OrderedDict.pop() to Argument Clinic
Type: performance Stage: resolved
Components: Argument Clinic, Extension Modules Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-07-18 14:33 by serhiy.storchaka, last changed 2020-07-19 06:19 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21534 merged serhiy.storchaka, 2020-07-18 14:34
Messages (2)
msg373905 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-07-18 14:33
The proposed PR converts OrderedDict.pop() to Argument Clinic. It makes it 2 times faster.

$ ./python -m pyperf timeit -q --compare-to=../cpython-release2/python -s "from collections import OrderedDict; od = OrderedDict()" "od.pop('x', None)"
Mean +- std dev: [/home/serhiy/py/cpython-release2/python] 119 ns +- 2 ns -> [/home/serhiy/py/cpython-release/python] 56.3 ns +- 1.2 ns: 2.12x faster (-53%)

It was not converted before because Argument Clinic generated incorrect signature for it. It still is not able to generate correct signature, but at least it does not generate incorrect signature. And we now have other reason for using Argument Clinic -- performance.
msg373933 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-07-19 06:19
New changeset 6bf3237379b17632db52cb39d181e8bac70173f3 by Serhiy Storchaka in branch 'master':
bpo-41333: Convert OrderedDict.pop() to Argument Clinic (GH-21534)
https://github.com/python/cpython/commit/6bf3237379b17632db52cb39d181e8bac70173f3
History
Date User Action Args
2020-07-19 06:19:41serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-07-19 06:19:06serhiy.storchakasetmessages: + msg373933
2020-07-18 14:34:09serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request20672
2020-07-18 14:33:13serhiy.storchakacreate