I'm just curious to hear other people's thoughts on why this specific piece of code might might run slower in Python 3.11 than in Python 3.10.6. Cross-posted from here. I'm new here - please kindly let me know if I'm doing something wrong.
test.py script:
import timeit
from random import random
def run():
for i in range(100):
j = random()
t = timeit.timeit(run, number=1000000)
print(t)
Commands:
(base) conda activate python_3_10_6
(python_3_10_6) python test.py
5.0430680999998
(python_3_10_6) conda activate python_3_11
(python_3_11) python test.py
5.801756700006081