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 rhettinger
Recipients rhettinger, xuxinhang
Date 2021-11-23.17:03:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637686983.78.0.310632385261.issue45880@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-11-23 17:03:04rhettingersetrecipients: + rhettinger, xuxinhang
2021-11-23 17:03:03rhettingersetmessageid: <1637686983.78.0.310632385261.issue45880@roundup.psfhosted.org>
2021-11-23 17:03:03rhettingerlinkissue45880 messages
2021-11-23 17:03:03rhettingercreate