GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enable specialization of iteration over generators, `for gen():`, and awaiting coroutines, `await coro()` · Issue #96793 · python/cpython

Enable specialization of iteration over generators, for gen():, and awaiting coroutines, await coro() #96793

New issue
Copy link
New issue
Copy link
Closed
Closed
Enable specialization of iteration over generators, for gen():, and awaiting coroutines, await coro()#96793
Copy link
Labels
performancePerformance or resource usagePerformance or resource usage

Description

@markshannon
markshannon
opened on Sep 13, 2022
Issue body actions

We want to be able to specialize iteration over generators and awaiting coroutines. Both for PEP 659 and for higher tier optimizers.

For the theory see faster-cpython/ideas#457

To do this we need:

  • Shim frames to keep the various returns simple GH-96421: Insert shim frame on entry to interpreter #96319
  • Modify FOR_ITER to leave iterator and value on the stack when exiting GH-96793: Change FOR_ITER to not pop the iterator on exhaustion. #96801
  • Implement specialization of FOR_ITER for generators GH-96793: Specialize FOR_ITER for generators. #98772
  • Implement specialization of SEND for coroutines

Edited:
Remove the requirement for a GEN_RETURN_VALUE instruction. We might want one to simplify frame popping, but it isn't needed for specializing.

  • PR: GH-96793: Implement PEP 479 in bytecode. #99006
  • PR: GH-96793: Specialize FOR_ITER for generators. #98772

Activity

  1. markshannon
    added
    performancePerformance or resource usagePerformance or resource usage
    on Sep 13, 2022
  2. markshannon
    added a commit that references this issue on Oct 27, 2022

    GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (G…

    22863df
  3. gvanrossum
    added a commit that references this issue on Oct 28, 2022

    pythonGH-96793: Change `FOR_ITER` to not pop the iterator on exhausti…

    97bcfe6
  4. markshannon
    added 2 commits that reference this issue on Nov 3, 2022

    GH-96793: Implement PEP 479 in bytecode. (GH-99006)

    f4adb97

    GH-96793: Specialize FOR_ITER for generators. (GH-98772)

    4a1c58d
  5. markshannon
    closed this as completedon Mar 16, 2023
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

    performancePerformance or resource usagePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.