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 serhiy.storchaka
Recipients larry, serhiy.storchaka
Date 2020-07-19.12:38:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595162309.27.0.341065260309.issue41342@roundup.psfhosted.org>
In-reply-to
Content
int.__round__ was not converted to Argument Clinic because it is not impossible to express a correct signature for it in Python. But now we can at least make Argument Clinic not producing incorrect signature. And converting to Argument Clinic has a performance benefit.

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python "round(12345)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 123 ns +- 6 ns -> [/home/serhiy/py/cpython-release/python] 94.4 ns +- 2.4 ns: 1.31x faster (-23%)

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python "round(12345, 0)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 159 ns +- 4 ns -> [/home/serhiy/py/cpython-release/python] 98.6 ns +- 2.4 ns: 1.61x faster (-38%)

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python "round(12345, -2)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 585 ns +- 9 ns -> [/home/serhiy/py/cpython-release/python] 534 ns +- 14 ns: 1.09x faster (-9%)
History
Date User Action Args
2020-07-19 12:38:29serhiy.storchakasetrecipients: + serhiy.storchaka, larry
2020-07-19 12:38:29serhiy.storchakasetmessageid: <1595162309.27.0.341065260309.issue41342@roundup.psfhosted.org>
2020-07-19 12:38:29serhiy.storchakalinkissue41342 messages
2020-07-19 12:38:29serhiy.storchakacreate