[issue26289] Optimize floor division for ints

Yury Selivanov report at bugs.python.org
Tue Feb 9 11:03:38 EST 2016


Yury Selivanov added the comment:

> Is it worth to move the optimization inside l_divmod? Will this speed up or slow down other operations that use l_divmod?

Attaching a new patch -- fast_divmod.patch

It combines patches for this issue and issue #26315.

Individual timeit benchmarks work as fast, but ** op becomes faster:

-m timeit -s "x=223" "x**2;x**-2;x**2;x**-3;x**3;x**-3;x**4.5;x**-4.5"
with patch: 1.2usec
without: 1.5usec

----------
Added file: http://bugs.python.org/file41871/fast_divmod.patch

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


More information about the Python-bugs-list mailing list