-
Notifications
You must be signed in to change notification settings - Fork 61
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
Speed up no-exclusive-tests and no-pending-tests #276
Conversation
Nice! Thank you for that contribution. I’ve also already started work on a major refactoring of astUtils to also address this and a few other issues, but it is a big change and still not finished yet. So I really appreciate such a small change that improves the performance significantly. In order to further decrease the performance I’ve introduce a benchmark test and set a performance budget. Can you check out this benchmark whether we can reduce the budged with this PR? See |
Thanks for the really fast answer! The speed numbers that I'd like to extend this approach for |
CQ doesn't like the reduced budget. This reverts commit 153609a.
… into speedup-rules
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.
Thanks. I would say let’s ship those changes. For further performance improvements we can create follow-up PRs.
The
isDescribe
andisTestCase
are doing a lot of work that is unnecessarily redone on each call expression.This PR moves this work upfront, when the rule is created and re-uses the result for each call expression.
Please note that the choosen implementation is not a strong opinion. I tried to keep the code churn to a minimum and not export more astUtils internals. Feel free to suggest how you prefer this to be solved differently.
We noticed the performance while linting the DevTools frontend. Running with the following command line:
Before the change:
After the change (the two eslint-plugin-mocha rules we use no longer show up in the TOP 10):