[New-bugs-announce] [issue41333] Convert OrderedDict.pop() to Argument Clinic

Serhiy Storchaka report at bugs.python.org
Sat Jul 18 10:33:13 EDT 2020


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
components: Argument Clinic, Extension Modules
messages: 373905
nosy: larry, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Convert OrderedDict.pop() to Argument Clinic
type: performance
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41333>
_______________________________________


More information about the New-bugs-announce mailing list