[issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary)

Mark Dickinson report at bugs.python.org
Wed Aug 5 07:21:31 EDT 2020


Mark Dickinson <dickinsm at gmail.com> added the comment:

I'd be opposed to changing Python's `int` implementation in this way: it adds complication to the codebase and potentially also slows down "normal" cases. If a user knows in advance (a) that they're using a divisor that's highly divisble by 2, and (b) that the division or modulo operation is performance critical, then they can take the appropriate steps to optimize their code.

----------

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


More information about the Python-bugs-list mailing list