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 methane
Recipients methane, vstinner, yselivanov
Date 2017-01-14.05:36:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484372173.8.0.704820340742.issue29263@psf.upfronthosting.co.za>
In-reply-to
Content
This is proof of concept patch to support LOAD_METHOD & CALL_METHOD for METH_FASTCALL methods.
(This patch should be applied after fastcall.patch)

$ ./python -m perf timeit --compare-to `pwd`/python-fastcall -s "d = b''" -- "d.decode()"
python-fastcall: ..................... 91.0 ns +- 1.0 ns
python: ..................... 80.3 ns +- 0.3 ns

Median +- std dev: [python-fastcall] 91.0 ns +- 1.0 ns -> [python] 80.3 ns +- 0.3 ns: 1.13x faster

$ ./python -m perf timeit --compare-to `pwd`/python-fastcall -s "d = b''" -- "d.decode('ascii')"
python-fastcall: ..................... 116 ns +- 1 ns
python: ..................... 106 ns +- 1 ns

Median +- std dev: [python-fastcall] 116 ns +- 1 ns -> [python] 106 ns +- 1 ns: 1.10x faster


Since PyCFunction is lighter than PyMethodObject, performance benefit seems smaller than
Python method (up to 20%).

Sadly speaking, there are only few METH_FASTCALL in builtin type.
History
Date User Action Args
2017-01-14 05:36:13methanesetrecipients: + methane, vstinner, yselivanov
2017-01-14 05:36:13methanesetmessageid: <1484372173.8.0.704820340742.issue29263@psf.upfronthosting.co.za>
2017-01-14 05:36:13methanelinkissue29263 messages
2017-01-14 05:36:13methanecreate