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

Optimise try-except code generation for the happy path #90616

Closed
iritkatriel opened this issue Jan 21, 2022 · 5 comments
Closed

Optimise try-except code generation for the happy path #90616

iritkatriel opened this issue Jan 21, 2022 · 5 comments
Assignees
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@iritkatriel
Copy link
Member

BPO 46458
Nosy @iritkatriel
PRs
  • bpo-46458: emit code for else of a try block immediately after the try body #30751
  • 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/iritkatriel'
    closed_at = <Date 2022-01-29.10:15:11.715>
    created_at = <Date 2022-01-21.15:26:03.256>
    labels = ['interpreter-core', '3.11', 'performance']
    title = 'Optimise try-except code generation for the happy path'
    updated_at = <Date 2022-01-29.10:15:11.714>
    user = 'https://github.com/iritkatriel'

    bugs.python.org fields:

    activity = <Date 2022-01-29.10:15:11.714>
    actor = 'iritkatriel'
    assignee = 'iritkatriel'
    closed = True
    closed_date = <Date 2022-01-29.10:15:11.715>
    closer = 'iritkatriel'
    components = ['Interpreter Core']
    creation = <Date 2022-01-21.15:26:03.256>
    creator = 'iritkatriel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46458
    keywords = ['patch']
    message_count = 5.0
    messages = ['411137', '411141', '411871', '412031', '412069']
    nosy_count = 1.0
    nosy_names = ['iritkatriel']
    pr_nums = ['30751']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue46458'
    versions = ['Python 3.11']

    @iritkatriel
    Copy link
    Member Author

    The compiler emits code for try-except-else-finally in the order in which it appears in the source, but it could probably produce faster code if it optimizes for the no-exception path.

    @iritkatriel iritkatriel added the 3.11 only security fixes label Jan 21, 2022
    @iritkatriel iritkatriel self-assigned this Jan 21, 2022
    @iritkatriel iritkatriel added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage 3.11 only security fixes labels Jan 21, 2022
    @iritkatriel iritkatriel self-assigned this Jan 21, 2022
    @iritkatriel iritkatriel added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Jan 21, 2022
    @iritkatriel
    Copy link
    Member Author

    See also the discussion on faster-cpython/ideas#226.

    @iritkatriel
    Copy link
    Member Author

    New changeset 3d2ce34 by Irit Katriel in branch 'main':
    bpo-46458: emit code for else of a try block immediately after the try body (GH-30751)
    3d2ce34

    @iritkatriel
    Copy link
    Member Author

    New changeset 36f538c by Irit Katriel in branch 'main':
    bpo-46458: Add tests for context of exception in finally block (GH-30986)
    36f538c

    @iritkatriel
    Copy link
    Member Author

    Re next steps, see faster-cpython/ideas#226 (comment).

    @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.11 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