Open
Description
Description
Starting from Python3.12.0, I noticed that the rstrip function is slower than Python3.11.11
The following is a small table that compares the results of my test with different Python versions:
Python3.11.10 VS Python3.11.11: I had almost the same value.
Python3.11.11 VS Python3.12.0: I had 25.91% loss.
Python3.11.11 VS Python3.12.9: I had 26.91% loss.
Python3.11.11 VS Python3.13.2: I had 15.94% loss.
Any explanation of this performance decrease ?
Thank you in advance.
Reproduction
- pyenv install {version}
- pyenv shell {version}
python3 -m timeit -n 1000 "for _ in range(10000): 'toto '.rstrip()"
Python versions tested on:
3.11.10
3.11.11
3.12.0
3.12.9
3.13.2
Operating systems tested on:
WSL