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

Use PEP 590 vectorcall to speed up calls to reversed() #86088

Closed
corona10 opened this issue Oct 3, 2020 · 3 comments
Closed

Use PEP 590 vectorcall to speed up calls to reversed() #86088

corona10 opened this issue Oct 3, 2020 · 3 comments
Assignees
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@corona10
Copy link
Member

corona10 commented Oct 3, 2020

BPO 41922
Nosy @vstinner, @corona10, @pablogsal
PRs
  • bpo-41922: Use PEP 590 vectorcall to speed up reversed() #22523
  • Files
  • bench_reversed.py
  • 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 = 'https://github.com/corona10'
    closed_at = <Date 2020-10-03.17:19:09.528>
    created_at = <Date 2020-10-03.16:00:56.690>
    labels = ['interpreter-core', '3.10', 'performance']
    title = 'Use PEP 590 vectorcall to speed up calls to reversed()'
    updated_at = <Date 2020-10-03.17:19:09.528>
    user = 'https://github.com/corona10'

    bugs.python.org fields:

    activity = <Date 2020-10-03.17:19:09.528>
    actor = 'corona10'
    assignee = 'corona10'
    closed = True
    closed_date = <Date 2020-10-03.17:19:09.528>
    closer = 'corona10'
    components = ['Interpreter Core']
    creation = <Date 2020-10-03.16:00:56.690>
    creator = 'corona10'
    dependencies = []
    files = ['49488']
    hgrepos = []
    issue_num = 41922
    keywords = ['patch']
    message_count = 3.0
    messages = ['377889', '377894', '377895']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'corona10', 'pablogsal']
    pr_nums = ['22523']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue41922'
    versions = ['Python 3.10']

    @corona10
    Copy link
    Member Author

    corona10 commented Oct 3, 2020

    reversed is also a very well-used type.
    if shows 10+ percent performance improvement from baseline and this metric.
    And this improvement looks acceptable from viewing builtin types which are applied PEP-590 (frozenset, list, set, dict)

    reversed creation + for loop
    Mean +- std dev: [reversed_master] 157 ns +- 4 ns -> [reversed_opt] 139 ns +- 2 ns: 1.13x faster (-11%)

    reversed creation
    Mean +- std dev: [reversed2_master] 118 ns +- 2 ns -> [reversed2_opt] 101 ns +- 2 ns: 1.18x faster (-15%)

    @corona10 corona10 added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Oct 3, 2020
    @corona10
    Copy link
    Member Author

    corona10 commented Oct 3, 2020

    New changeset d646e91 by Dong-hee Na in branch 'master':
    bpo-41922: Use PEP-590 vectorcall to speed up reversed() (GH-22523)
    d646e91

    @corona10
    Copy link
    Member Author

    corona10 commented Oct 3, 2020

    Thank you Victor!

    @corona10 corona10 reopened this Oct 3, 2020
    @corona10 corona10 reopened this Oct 3, 2020
    @corona10 corona10 closed this as completed Oct 3, 2020
    @corona10 corona10 closed this as completed Oct 3, 2020
    @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 interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant