diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2016-02-11 15:26:27 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2016-02-11 15:26:27 (GMT) |
commit | e0b23095ee03a11d09f38cbc689307dc5c93afda (patch) | |
tree | 4854be21dd4b87937cf03583bd599c1f8d3ddebd /Doc/reference | |
parent | 2da89d70fcad24cc266f6919aadd40c0838c4c5f (diff) | |
download | cpython-e0b23095ee03a11d09f38cbc689307dc5c93afda.zip cpython-e0b23095ee03a11d09f38cbc689307dc5c93afda.tar.gz cpython-e0b23095ee03a11d09f38cbc689307dc5c93afda.tar.bz2 |
Issues #26289 and #26315: Optimize floor/modulo div for single-digit longs
Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function
is now also ~10% faster.
-m timeit -s "x=22331" "x//2;x//-3;x//4;x//5;x//-6;x//7;x//8;x//-99;x//100;"
with patch: 0.321 without patch: 0.633
-m timeit -s "x=22331" "x%2;x%3;x%-4;x%5;x%6;x%-7;x%8;x%99;x%-100;"
with patch: 0.224 without patch: 0.66
Big thanks to Serhiy Storchaka, Mark Dickinson and Victor Stinner for
thorow code reviews and algorithms improvements.
Diffstat (limited to 'Doc/reference')
0 files changed, 0 insertions, 0 deletions