Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

On the current 3.11, I do get a speedup below a power of two, but a slight 
degradation (as expected) at power of two.

python3.11 -m timeit -s 'from random import randrange' 'randrange(65535)'
python3.11 -m timeit -s 'from random import randrange' 'randrange(65536)'

Also, I used PyPy3 on its 3.7 version of random.py but with the modern code for 
_getrandbits.  There was no discernible change with and without the proposed 
edit.

Please go ahead and update to the best version of your patch.

I'll mark this BPO issue as "later" and will run tests again as 3.11 gets close 
to a release.  Right now, CPython's performance is still in flux and it is too 
early to try tune application code the current version.

----------
resolution:  -> later
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to