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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnusedVariableSniff: add scope lookup cache to improve performance #941

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

nightlinus
Copy link
Contributor

Increase performance of UnusedVariableSniff by introducing scope lookup cache in ScopeHelper.

For 8kloc test file time dropped from 9s to 0.6s

@kukulich
Copy link
Contributor

I expect the same problem as in other PR - not 100 % code coverage.

@kukulich kukulich added this to the 6.2.0 milestone Mar 25, 2020
}
}

return 0; // @codeCoverageIgnore because there is at least one root always
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added this line to ignore because otherwise phpstan checks not green

@nightlinus
Copy link
Contributor Author

Should work now, local coverage 100%, done for now, all sniffs are under 0.7s for my ugly 8kloc file.
Great project, ty for your time and speed. I hope i broke nothing.

@kukulich kukulich merged commit a2f8ec6 into slevomat:master Mar 25, 2020
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

2 participants