Skip to content

Conversation

@markshannon
Copy link
Member

@markshannon markshannon commented Dec 2, 2021

Similar to #29729 which made space for the InterpreterFrame in the frame object. This does the same for generators.

https://bugs.python.org/issue45963

@markshannon
Copy link
Member Author

Skipping news as this is very much an internal implementation detail.

@markshannon
Copy link
Member Author

No significant change in performance

@markshannon markshannon merged commit 299483c into python:main Dec 6, 2021
@pablogsal
Copy link
Member

pablogsal commented Dec 7, 2021

Unfortunately, all refleak buildbots are failing after 299483c was merged. I bisected the problem to it:

299483c95d601ddcfdce2f96418b6499c1fc7b9f is the first bad commit
commit 299483c95d601ddcfdce2f96418b6499c1fc7b9f
Author: Mark Shannon <[email protected]>
Date:   Mon Dec 6 10:13:49 2021 +0000

    [bpo-45963](https://bugs.python.org/issue45963): Make space for the InterpreterFrame of a generator in that generator. (GH-29891)

    * Make generator, coroutine and async gen structs all the same size.

    * Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.

 Include/cpython/genobject.h     |  23 ++---
 Include/internal/pycore_ceval.h |   2 +-
 Include/internal/pycore_frame.h |   2 +-
 Lib/test/test_sys.py            |   2 +-
 Objects/genobject.c             | 183 ++++++++++++++++++++++------------------
 Python/ceval.c                  |  41 +++------
 Python/frame.c                  |  18 ++--
 7 files changed, 127 insertions(+), 144 deletions(-)

Following out buildbot policy, the change will need to be reverted if is not fixed in 24 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants