[issue24076] sum() several times slower on Python 3 64-bit

Stefan Behnel report at bugs.python.org
Sun Aug 12 08:36:17 EDT 2018


Stefan Behnel <stefan_ml at behnel.de> added the comment:

FWIW, a PGO build of Py3.7 is now about 20% *faster* here than my Ubuntu 16/04 system Python 2.7, and for some (probably unrelated) reason, the system Python 3.5 is another 2% faster on my side.

IMHO, the only other thing that seems obvious to try would be to inline the unpacking of single digit PyLongs into sum(). I attached a simple patch that does that, in case someone wants to test it out. For non-PGO builds, it's about 17% faster for me. Didn't take the time to benchmark PGO builds with it.

----------
versions:  -Python 3.5
Added file: https://bugs.python.org/file47748/unpack_single_digits.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24076>
_______________________________________


More information about the Python-bugs-list mailing list