[issue45963] Embed interpreter frame in generator.

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Leak fixed by:

commit 064e53d19aea6d6906fa8f7706a2556a2c293ccd
Author: Mark Shannon 
Date:   Tue Dec 7 18:05:48 2021 +

Fix leak when an exception is raised during generator creation. (GH-29960)

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +28185
pull_request: https://github.com/python/cpython/pull/29960

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Mark Shannon


Mark Shannon  added the comment:

I'll look into it now, and fix or revert it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is also unfortunately blocking the 3.11.a3 release :(

--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

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

299483c95d601ddcfdce2f96418b6499c1fc7b9f is the first bad commit
commit 299483c95d601ddcfdce2f96418b6499c1fc7b9f
Author: Mark Shannon 
Date:   Mon Dec 6 10:13:49 2021 +

bpo-45963: 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.

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-06 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 299483c95d601ddcfdce2f96418b6499c1fc7b9f by Mark Shannon in 
branch 'main':
bpo-45963: Make space for the InterpreterFrame of a generator in that 
generator. (GH-29891)
https://github.com/python/cpython/commit/299483c95d601ddcfdce2f96418b6499c1fc7b9f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-02 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +28115
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29891

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45963] Embed interpreter frame in generator.

2021-12-02 Thread Mark Shannon


New submission from Mark Shannon :

Currently, the InterpreterFrame for a generator is allocated on the heap 
separately from the generator.
This means that 2 allocations are needed to create a generator, and an extra 
indirection is needed to get from the generator to the frame.

By embedding the frame in the generator, we only need one alloaction, we save 
an indirection *and* the code gets simpler: transferring the frame from 
generator to frame object is just a single memcpy.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 407526
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Embed interpreter frame in generator.
type: performance
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com