-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R1707 (trailing-comma-tuple) checks perform excessive is_message_enabled calls #9608
Labels
Enhancement ✨
Improvement to a component
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
performance
Milestone
Comments
correctmost
added
the
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
label
May 7, 2024
Pierre-Sassoulas
added
Enhancement ✨
Improvement to a component
performance
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
May 7, 2024
Wow, this one is shocking, should have been a low hanging fruits during review. Thanks again, this is very valuable. |
And in a performance MR of all thing 😄 #8606 |
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 7, 2024
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Wait, no, we kinda need to do that on each line (not each token though, and we don't need to recheck everything). The enabling / disabling can be per line. |
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 8, 2024
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 8, 2024
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 13, 2024
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 13, 2024
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 13, 2024
Performance analysis by correctmost. Follow up to fix the known limitation will be in pylint-dev#9609 Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Pierre-Sassoulas
added a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
May 13, 2024
Performance analysis by correctmost. Follow up to fix the known limitation will be in pylint-dev#9609 Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Enhancement ✨
Improvement to a component
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
performance
Bug description
RefactoringChecker::process_tokens
has a loop with an embeddedself.linter.is_message_enabled("trailing-comma-tuple")
call:pylint/pylint/checkers/refactoring/refactoring_checker.py
Lines 652 to 665 in 7521eb1
This call gets executed ~1.4 million times when running pylint on the yt-dlp repo. Hoisting the
is_message_enabled
call outside of the loop can bring the number of executions down to ~1100.Configuration
Command used
Steps to reproduce
Analysis
process_tokens
callsis_message_enabled
~1.4 million times:Pylint output
There are some R1707 errors, but the output is less important than the performance numbers.
Expected behavior
Improved performance via reduced
is_message_enabled
callsPylint version
OS / Environment
Arch Linux
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: