Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert OrderedDict.pop() to Argument Clinic #85505

Closed
serhiy-storchaka opened this issue Jul 18, 2020 · 2 comments
Closed

Convert OrderedDict.pop() to Argument Clinic #85505

serhiy-storchaka opened this issue Jul 18, 2020 · 2 comments
Labels
3.10 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage topic-argument-clinic

Comments

@serhiy-storchaka
Copy link
Member

BPO 41333
Nosy @rhettinger, @larryhastings, @serhiy-storchaka
PRs
  • bpo-41333: Convert OrderedDict.pop() to Argument Clinic #21534
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-07-19.06:19:41.820>
    created_at = <Date 2020-07-18.14:33:13.895>
    labels = ['extension-modules', 'expert-argument-clinic', '3.10', 'performance']
    title = 'Convert OrderedDict.pop() to Argument Clinic'
    updated_at = <Date 2020-07-19.06:19:41.820>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-07-19.06:19:41.820>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-07-19.06:19:41.820>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Argument Clinic']
    creation = <Date 2020-07-18.14:33:13.895>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41333
    keywords = ['patch']
    message_count = 2.0
    messages = ['373905', '373933']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'larry', 'serhiy.storchaka']
    pr_nums = ['21534']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue41333'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added 3.10 only security fixes extension-modules C modules in the Modules dir topic-argument-clinic performance Performance or resource usage labels Jul 18, 2020
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 6bf3237 by Serhiy Storchaka in branch 'master':
    bpo-41333: Convert OrderedDict.pop() to Argument Clinic (GH-21534)
    6bf3237

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage topic-argument-clinic
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant