Message409446
As discussed on python-dev, it would be nice to break long_pow()'s reliance on that the number of bits in a CPython long "digit" is a multiple of 5.
Moving to the sliding-window algorithm would do that (it has to be able to cross digit boundaries to fill the current window), and would be better on some other counts too: the precomputed table can be half the size (or we can add an extra bit to the window for the same table size), and it can - depending on exponent bit patterns - sometimes reduce the number of multiplies needed too.
So I intend to do that, and bump the window size from 5 to 6 (which would yield a significant, although modest, speed improvement for giant-exponent cases). |
|
Date |
User |
Action |
Args |
2022-01-01 01:46:40 | tim.peters | set | recipients:
+ tim.peters |
2022-01-01 01:46:39 | tim.peters | set | messageid: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org> |
2022-01-01 01:46:39 | tim.peters | link | issue46218 messages |
2022-01-01 01:46:39 | tim.peters | create | |
|