Author vstinner
Recipients serhiy.storchaka, vstinner
Date 2017-01-10.17:50:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484070646.73.0.530578838486.issue29227@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch reduce C stack consumption in function calls. It's the follow-up of the issue #28870.


Reference (rev a30cdf366c02):

test_python_call: 7175 calls before crash, stack: 1168 bytes/call
test_python_getitem: 6235 calls before crash, stack: 1344 bytes/call
test_python_iterator: 5344 calls before crash, stack: 1568 bytes/call

=> total: 18754 calls, 4080 bytes


With "Inline call_function() in ceval.c":

test_python_call: 7936 calls before crash, stack: 1056 bytes/call
test_python_getitem: 6387 calls before crash, stack: 1312 bytes/call
test_python_iterator: 5755 calls before crash, stack: 1456 bytes/call

=> total: 20078 calls, 3824 bytes


With inline and "_PY_FASTCALL_SMALL_STACK: 5 arg (40 B) => 3 arg (24 B)":

test_python_call: 8058 calls before crash, stack: 1040 bytes/call
test_python_getitem: 6630 calls before crash, stack: 1264 bytes/call
test_python_iterator: 5952 calls before crash, stack: 1408 bytes/call

=> total: 20640 calls, 3712 bytes


I applied testcapi_stack_pointer.patch and run stack_overflow_28870-sp.py of the issue #28870 to produce these statistics.

With the patch, Python 3.7 is still not as good as Python 3.5 (msg285109), but it's a first enhancement.
History
Date User Action Args
2017-01-10 17:50:46vstinnersetrecipients: + vstinner, serhiy.storchaka
2017-01-10 17:50:46vstinnersetmessageid: <1484070646.73.0.530578838486.issue29227@psf.upfronthosting.co.za>
2017-01-10 17:50:46vstinnerlinkissue29227 messages
2017-01-10 17:50:46vstinnercreate