Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation on select analysis #5082

Merged
merged 1 commit into from Aug 10, 2023
Merged

Conversation

alanmcruickshank
Copy link
Member

@alanmcruickshank alanmcruickshank commented Aug 10, 2023

Debugging performance of AL05, I found this optimisation. It cuts the runtime of AL05 on my test file (a big mess query) by 10x!! 馃帀 馃殌

In essence we were recursively exploring far too much of the parse tree and then going back to work out which elements to remove at the end of that recursion. The more efficient way to solve that is just to limit recursion in the first place. Double saving of 1) faster tree traversal and 2) not needing to prune them back off again later.

Across a blended project it has the following impacts on time spent:

  • AL04 -75%
  • AL05 -68%
  • AM04 -60%
  • RF01 -35%
  • ST05 -47%

Especially exciting that these are some of the longest running rules. Overall reduction in linting time of ~30% (with the caveat that results may vary depending on project makeup and the rules enabled on the project).

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same when pulling d5086ab on ac/select_optimisations into fc91dcd on main.

@alanmcruickshank alanmcruickshank marked this pull request as ready for review August 10, 2023 10:15
Copy link
Contributor

@WittierDinosaur WittierDinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely huge!

@alanmcruickshank alanmcruickshank added this pull request to the merge queue Aug 10, 2023
Merged via the queue into main with commit 33916fc Aug 10, 2023
29 checks passed
@alanmcruickshank alanmcruickshank deleted the ac/select_optimisations branch August 10, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants