]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19171: speed some cases of 3-argument long pow().
authorTim Peters <tim@python.org>
Sat, 5 Oct 2013 21:55:38 +0000 (16:55 -0500)
committerTim Peters <tim@python.org>
Sat, 5 Oct 2013 21:55:38 +0000 (16:55 -0500)
Reduce the base by the modulus when the base is larger than
the modulus.  This can unboundedly speed the "startup costs"
of doing modular exponentiation, particularly in cases where
the base is much larger than the modulus.  Original patch
by Armin Rigo, inspired by https://github.com/pyca/ed25519.

Merged from 3.3.

1  2 
Objects/longobject.c

Simple merge