-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Optimize is_trailing_comma()
#8606
Optimize is_trailing_comma()
#8606
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8606 +/- ##
==========================================
- Coverage 95.91% 95.91% -0.01%
==========================================
Files 174 174
Lines 18417 18416 -1
==========================================
- Hits 17665 17664 -1
Misses 752 752
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! Reading the MR you linked was entertaining: we increased the timeout on it and did no deep analysis of the performance. I suppose we were reaching the timeout regularly before and this was the straw that made us reach the timeout too much. Motivation to add benchmark regression primers (discussed in the issue) reactivated :D
Thanks for the review! I have an additional commit to push to this branch, but wanted to wait for the primer 3.7 job to finish first (hopefully it's almost done!)--just to make sure it finishes reasonably. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! The second optimization with self.linter.is_message_enabled(
would be huge if used everywhere, but this would require design to be done right imo (@utils.only_required_for_messages
working for token based checker and a check to verify that it's used when required and not used when not required ?)
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit e1e5643 |
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
Performance analysis by correctmost Refs pylint-dev#8606 (follow-up) Closes pylint-dev#9608
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
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
Type of Changes
Description
Refs #5534
When profiling a lint over
pygame
, I see a savings of over 2s on my M1 Mac/Python3.11:Before
ncalls tottime percall cumtime percall filename:lineno(function)
493189 3.580 0.000 3.640 0.000 refactoring_checker.py:88(_is_trailing_comma)
After
ncalls tottime percall cumtime percall filename:lineno(function)
493189 1.346 0.000 1.400 0.000 refactoring_checker.py:88(_is_trailing_comma)