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 Demur Rumed, ezio.melotti, jstasiak, pitrou, python-dev, rhettinger, scoder, serhiy.storchaka, vstinner, yselivanov
Date 2016-12-01.15:49:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480607353.09.0.732226109095.issue23507@psf.upfronthosting.co.za>
In-reply-to
Content
Serhiy: "I don't propose to commit this complicated patch, but these results can be used as a guide to the optimization of tuple creating. It is surprising to me that this patch has any effect at all."

A new "fast call" calling convention was added to Python 3.6 to avoid the creation of temporary tuples to pass function arguments. Benchmarks confirm that Python 3.7 is faster than Python 3.5 of functions that Serhiy suggested to optimize. I confirm that I was also surprised that fast call has a significant effect on performance!

Fast calls don't require complex code like reuse_argtuples_3.patch which requires to check carefully the reference counter. In the past, a similar optimization on property_descr_get() introduced complex bugs: see issue #24276 and issue #26811. Fast calls don't use such issues.

The implementation of fast calls is currently incomplete: tp_new, tp_init and tp_call slots still require a tuple and a dict for positional and keyword arguments. I'm working on an enhancement for Python 3.7 to support also fast calls for these slots. In the meanwhile, callbacks using tp_call don't benefit yet on fast calls.

That's why I had to keep the tuple/refcount optimization in property_descr_get(), to not introduce a performance regression.

I consider that this issue can now be closed as "fixed".
History
Date User Action Args
2016-12-01 15:49:13vstinnersetrecipients: + vstinner, rhettinger, pitrou, scoder, ezio.melotti, python-dev, serhiy.storchaka, yselivanov, jstasiak, Demur Rumed
2016-12-01 15:49:13vstinnersetmessageid: <1480607353.09.0.732226109095.issue23507@psf.upfronthosting.co.za>
2016-12-01 15:49:13vstinnerlinkissue23507 messages
2016-12-01 15:49:12vstinnercreate