-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedperformancePerformance or resource usagePerformance or resource usagetype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedperformancePerformance or resource usagePerformance or resource usagetype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error