[issue29421] Make int.to_bytes() and int.from_bytes() slightly faster

STINNER Victor report at bugs.python.org
Thu Feb 2 09:44:21 EST 2017


STINNER Victor added the comment:

Ah yes, I began with the exact same change when I experimented optimizing to_bytes():
http://bugs.python.org/issue29300#msg286781

I was going to suggest you the same, but the speedup was low compared to the cost of parsing arguments.

Anyway, int-to_bytes-from_bytes.patch is safe, LGTM, and the speedup is significant.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29421>
_______________________________________


More information about the Python-bugs-list mailing list