This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abo
Recipients abo
Date 2021-01-27.13:07:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611752833.52.0.275617605532.issue43040@roundup.psfhosted.org>
In-reply-to
Content
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...
History
Date User Action Args
2021-01-27 13:07:13abosetrecipients: + abo
2021-01-27 13:07:13abosetmessageid: <1611752833.52.0.275617605532.issue43040@roundup.psfhosted.org>
2021-01-27 13:07:13abolinkissue43040 messages
2021-01-27 13:07:13abocreate