Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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).