Skip to content

Clean up the C3 MRO algorithm implementation. #76566

Closed

Description

@serhiy-storchaka
BPO 32385
Nosy @pitrou, @serhiy-storchaka
PRs
  • bpo-32385: Clean up the C3 MRO algorithm implementation. #4942
  • 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 2017-12-20.17:26:59.280>
    created_at = <Date 2017-12-20.15:40:56.445>
    labels = ['interpreter-core', '3.7', 'performance']
    title = 'Clean up the C3 MRO algorithm implementation.'
    updated_at = <Date 2017-12-20.17:26:59.280>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-12-20.17:26:59.280>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-12-20.17:26:59.280>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2017-12-20.15:40:56.445>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32385
    keywords = ['patch']
    message_count = 3.0
    messages = ['308739', '308751', '308752']
    nosy_count = 2.0
    nosy_names = ['pitrou', 'serhiy.storchaka']
    pr_nums = ['4942']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue32385'
    versions = ['Python 3.7']

    Activity

    1. serhiy-storchaka commented on Dec 20, 2017

      @serhiy-storchaka
      MemberAuthor

      The C3 MRO algorithm implementation uses lists and converts input tuples to lists. This is redundant, because these lists are not mutated. The proposed PR makes the implementation using tuples and gets rid of unneeded conversions.

    2. added
      3.7 (EOL)
      interpreter-core
      performance
      on Dec 20, 2017
    3. serhiy-storchaka commented on Dec 20, 2017

      @serhiy-storchaka
      MemberAuthor

      This has also a performance effect.

      $ ./python -m perf timeit -s "class A: pass" -s "class B: pass" --duplicate 1000  "class C(A, B): pass"

      Before: Mean +- std dev: 9.41 us +- 0.28 us
      After: Mean +- std dev: 8.94 us +- 0.28 us

    4. serhiy-storchaka commented on Dec 20, 2017

      @serhiy-storchaka
      MemberAuthor

      New changeset 6b91a59 by Serhiy Storchaka in branch 'master':
      bpo-32385: Clean up the C3 MRO algorithm implementation. (bpo-4942)
      6b91a59

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)interpreter-coreperformance

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions