Message285457
| 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:13 | methane | set | recipients:
+ methane, vstinner, yselivanov |
| 2017年01月14日 05:36:13 | methane | set | messageid: <1484372173.8.0.704820340742.issue29263@psf.upfronthosting.co.za> |
| 2017年01月14日 05:36:13 | methane | link | issue29263 messages |
| 2017年01月14日 05:36:13 | methane | create |
|