Message385769
I encountered a very significant slowdown migrating some code from python2.7 to python3.9 that I tracked down to randrange() being slow. After digging I noticed that _randbelow_with_getrandbits() calls getrandbits() 2x as many times, and asks for one more bit each time, than is actually required if the range requested is a power of 2.
I have a GitHub PR on the way to fix this... |
|
Date |
User |
Action |
Args |
2021-01-27 13:07:13 | abo | set | recipients:
+ abo |
2021-01-27 13:07:13 | abo | set | messageid: <1611752833.52.0.275617605532.issue43040@roundup.psfhosted.org> |
2021-01-27 13:07:13 | abo | link | issue43040 messages |
2021-01-27 13:07:13 | abo | create | |
|