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 sir-sigurd
Recipients sir-sigurd
Date 2018-08-01.05:09:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533100143.91.0.56676864532.issue34303@psf.upfronthosting.co.za>
In-reply-to
Content
`PyTuple_SetItem()` can be replaced with macro version and `PyObject_Call()` can be used instead of `PyEval_CallObject()`.

Here's benchmark results:

$ python -m perf timeit --compare-to ~/tmp/cpython-master-venv/bin/python -s "from functools import reduce; from operator import is_; r = range(50000)" "reduce(is_, r)"
/home/sergey/tmp/cpython-master-venv/bin/python: ..................... 1.64 ms +- 0.01 ms
/home/sergey/tmp/cpython-venv/bin/python: ..................... 1.40 ms +- 0.00 ms

Mean +- std dev: [/home/sergey/tmp/cpython-master-venv/bin/python] 1.64 ms +- 0.01 ms -> [/home/sergey/tmp/cpython-venv/bin/python] 1.40 ms +- 0.00 ms: 1.17x faster (-15%)
History
Date User Action Args
2018-08-01 05:09:03sir-sigurdsetrecipients: + sir-sigurd
2018-08-01 05:09:03sir-sigurdsetmessageid: <1533100143.91.0.56676864532.issue34303@psf.upfronthosting.co.za>
2018-08-01 05:09:03sir-sigurdlinkissue34303 messages
2018-08-01 05:09:03sir-sigurdcreate