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

2017-02-02 Thread STINNER Victor
STINNER Victor added the comment: 3 empty notifications from Roundup Robot :-/ -- ___ Python tracker ___ ___ Python-bugs-list mailing

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

2017-02-02 Thread Roundup Robot
Changes by Roundup Robot : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/pytho

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

2017-02-02 Thread Roundup Robot
Changes by Roundup Robot : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/pytho

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

2017-02-02 Thread Roundup Robot
Changes by Roundup Robot : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/pytho

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

2017-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset f0c1bbce09dc21d82965f1706b30b69e285ca4d3 by Serhiy Storchaka in branch 'master': Issue #29421: Make int.to_bytes() and int.from_bytes() slightly faster https://github.com/python/cpython/commit/f0c1bbce09dc21d82965f1706b30b69e285ca4d3 --

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

2017-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tried this optimization few years ago. But with slow PyArg_ParseTupleAndKeywords() the effect was smaller and without _PyUnicode_EqualToASCIIId() the code was more cumbersome. -- resolution: -> fixed stage: patch review -> resolved status: open ->

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

2017-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 52c5a7c6 by Serhiy Storchaka in branch 'default': Issue #29421: Make int.to_bytes() and int.from_bytes() slightly faster https://hg.python.org/cpython/rev/52c5a7c6 -- nosy: +python-dev ___ Python

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

2017-02-02 Thread STINNER Victor
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

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

2017-02-02 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes int.to_bytes() and int.from_bytes() slightly faster. $ ./python -m perf timeit '1 .to_bytes(4, "little")' --compare-to "`pwd`/python0" Median +- std dev: [python0] 1.28 us +- 0.07 us -> [python] 1.17 us +- 0.07 us: 1.09x faster (-8%)