
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-05-31 18:29 byarigo, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1938 | closed | serhiy.storchaka,2017-06-04 09:38 | |
| PR 5076 | merged | serhiy.storchaka,2018-01-01 20:06 | |
| Messages (8) | |||
|---|---|---|---|
| msg244552 -(view) | Author: Armin Rigo (arigo)*![]() | Date: 2015-05-31 18:29 | |
The computation of `co_stacksize' by the compiler is known to give only an upper bound estimate.http://bugs.python.org/issue1754094 is an example of fixing a "leak" where every repetition of a statement makes `co_stacksize' bigger by 1. However, in the whole 3.x series (from at least 3.2), the following simple code, which at runtime requires about 4 or 5 stack slots, leaks 14(!) slots for every `try:' block. Maybe this should be improved to reduce the extreme size of the leak.def g(): try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass ...i.e. any function that is big enough to contain 6 try: blocks in sequence will have its stack size overestimated by about 70. | |||
| msg295118 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-06-04 09:44 | |
PR 1938 tries to balance the stack effect computation for try/except and try/finally. I'm not sure that it is worth backporting.Noised Antoine and Benjamin as people related toissue3021. | |||
| msg295119 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-06-04 09:45 | |
I'm against backporting performance improvements which don't fix a severe regression. | |||
| msg295122 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-06-04 11:06 | |
This isn't so easy. Seems the simplest way to solve this issue is implementingissue17611. | |||
| msg305677 -(view) | Author: Neil Schemenauer (nascheme)*![]() | Date: 2017-11-06 21:03 | |
The WIP pull request PR# 2827 seems to help. The following code prints 86 on python3.6 and 25 withPR 2827 applied.def g(): try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: passprint(g.__code__.co_stacksize) | |||
| msg309346 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2018-01-01 20:08 | |
WithPR 5076 the result of the above example is 10. | |||
| msg309347 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2018-01-01 20:10 | |
Tests originally based on Antoine's tests added forPR 2827. | |||
| msg309733 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2018-01-09 19:54 | |
New changesetd4864c61e3e27e337762dc45e504977299bd5b46 by Serhiy Storchaka in branch 'master':bpo-24340: Fix estimation of the code stack size. (#5076)https://github.com/python/cpython/commit/d4864c61e3e27e337762dc45e504977299bd5b46 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:17 | admin | set | github: 68528 |
| 2018-01-11 19:28:17 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-01-09 19:54:55 | serhiy.storchaka | set | messages: +msg309733 |
| 2018-01-03 18:24:32 | serhiy.storchaka | link | issue31113 dependencies |
| 2018-01-03 18:19:39 | serhiy.storchaka | link | issue32455 dependencies |
| 2018-01-01 20:13:02 | serhiy.storchaka | link | issue17611 dependencies |
| 2018-01-01 20:10:37 | serhiy.storchaka | set | messages: +msg309347 |
| 2018-01-01 20:08:55 | serhiy.storchaka | set | messages: +msg309346 |
| 2018-01-01 20:06:58 | serhiy.storchaka | set | keywords: +patch pull_requests: +pull_request4950 |
| 2017-11-06 21:03:15 | nascheme | set | messages: +msg305677 |
| 2017-11-06 19:51:18 | nascheme | set | nosy: +nascheme |
| 2017-08-30 12:26:52 | serhiy.storchaka | set | pull_requests: -pull_request3289 |
| 2017-08-30 12:18:41 | serhiy.storchaka | set | pull_requests: +pull_request3289 |
| 2017-06-04 11:06:19 | serhiy.storchaka | set | messages: +msg295122 |
| 2017-06-04 09:45:47 | pitrou | set | messages: +msg295119 |
| 2017-06-04 09:44:13 | serhiy.storchaka | set | versions: - Python 3.6 nosy: +pitrou,benjamin.peterson messages: +msg295118 stage: needs patch -> patch review |
| 2017-06-04 09:38:43 | serhiy.storchaka | set | pull_requests: +pull_request2017 |
| 2017-06-04 06:01:43 | arigo | set | versions: + Python 3.7 |
| 2017-02-21 09:51:04 | serhiy.storchaka | set | nosy: +serhiy.storchaka |
| 2017-02-21 08:44:58 | methane | set | nosy: +methane |
| 2015-06-01 18:28:51 | arigo | set | nosy: -arigo |
| 2015-06-01 17:21:00 | Arfrever | set | nosy: +Arfrever |
| 2015-06-01 07:23:47 | pitrou | set | stage: needs patch type: resource usage versions: + Python 3.6 |
| 2015-05-31 20:51:18 | yselivanov | set | nosy: +yselivanov |
| 2015-05-31 18:29:54 | arigo | create | |