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

Here are timings from stock macOS builds from python.org:

$ python3.10 --version
Python 3.10.0
$ python3.10 -m timeit -r 11 -s 'x=5' 'x^3'      # Xor with variable
5000000 loops, best of 11: 41.4 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x=5' 'x+3'      # Add with variable
10000000 loops, best of 11: 22.7 nsec per loop
$ python3.10 -m timeit -r 11 -s '3 + 5'          # Constant folded
50000000 loops, best of 11: 7.15 nsec per loop

$ python3.11 --version
Python 3.11.0a2
$ python3.11 -m timeit -r 11 -s 'x=5' 'x^3'
20000000 loops, best of 11: 19.2 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x=5' 'x+3'
10000000 loops, best of 11: 22.5 nsec per loop
$ python3.10 -m timeit -r 11 -s '3 + 5'
50000000 loops, best of 11: 7.16 nsec per loop

----------
nosy: +rhettinger

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

Reply via email to