This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2022-02-01.13:06:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643720760.9.0.302596428689.issue46600@roundup.psfhosted.org>
In-reply-to
Content
Measure using this script on the main branch (commit 108e66b6d23efd0fc2966163ead9434b328c5f17):
---
import _testcapi
def f(): yield _testcapi.stack_pointer()
print(_testcapi.stack_pointer() - next(f()))
---

Stack usage depending on the compiler and compiler optimization level:

* clang -O0: 9,104 bytes
* clang -Og: 736 bytes
* gcc -O0: 6,784 bytes
* gcc -Og: 624 bytes

-O0 allocates around 10x more memory.

Moreover, "./configure --with-pydebug CC=clang" uses -O0 in CFLAGS, because "clang --help" output doesn't containt "-Og". I'm working on a configure change to use -Og on clang which supports it.
History
Date User Action Args
2022-02-01 13:06:00vstinnersetrecipients: + vstinner
2022-02-01 13:06:00vstinnersetmessageid: <1643720760.9.0.302596428689.issue46600@roundup.psfhosted.org>
2022-02-01 13:06:00vstinnerlinkissue46600 messages
2022-02-01 13:06:00vstinnercreate