[issue45880] Performance regression of Int object operators. (Python 3.11)

Raymond Hettinger report at bugs.python.org
Tue Nov 23 15:27:23 EST 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Reposting with more careful timing runs.  No regression was observed.

$ 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.7 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 '5+3'             # Constant folded
50000000 loops, best of 11: 7.22 nsec per loop

$ python3.11 --version
Python 3.11.0a2
$ python3.11 -m timeit -r 11 -s 'x=5' 'x^3'    # Xor with variable
20000000 loops, best of 11: 19.4 nsec per loop
$ python3.11 -m timeit -r 11 -s 'x=5' 'x+3'    # Add with variable
20000000 loops, best of 11: 17 nsec per loop
$ python3.11 -m timeit -r 11 '5+3'             # Constant folded
50000000 loops, best of 11: 7.27 nsec per loop

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45880>
_______________________________________


More information about the Python-bugs-list mailing list