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
Perfomance degradation in import plugin after eslint 6 #13722
Comments
Thanks for the issue. We don't maintain import plugin. I guess you can create an issue in import plugin repo. The core rules do seem fine as there is not much increase in the time. the increase in time is because of the new features (and options) added to it (I am referring to |
Yup, I understand that it's a third party plugin. But ESlint somehow degraded it's performance on update. And I suppose that ESLint developers will be able to find the reason better then plugin maintainer. After all, I suppose that not only this plugin suffered from degradation. By the way, I narrowed the problem. Everything was still fine with eslint@6.0.0-alpha.0 but degraded in eslint@6.0.0-alpha.1. |
Narrowed the problem to commit 6ae21a4 |
@mysticatea could you take a look? Seems like that's your PR #11546 |
Whats the output with update plugins and also with eslint 7 ? |
Absolutely same :( |
There’s likely not an issue with the import plugin at all. Note that the rule order is different before and after upgrading. It’s not the rules or the plugin that is the problem, it’s all the bootstrapping ESLint is doing before even running the first rule. Config is pretty complicated, which is why we are replacing it with a simpler system. Unfortunately, I don’t think we can boost the performance of configs right now without jeopardizing current work. I’m pushing forward on #13481 as fast as I can. |
@nzakas Yeah, you are right! I just tried disabling slow rules and found out that total time stayed same, and other rules became "slow". Really seems like a bug with timings which counts in ESLint bootstrapping. May be we need one more separate timing for bootstrapping? Good luck with #13481, seems like we'll have to wait for it before upgrading from ESLint 5. |
I think that timing already measures only time spent in listeners: Lines 934 to 941 in c1974b3
@jehy when you disable slow rules, the other rules that became slow are also |
Some more samples @mdjermanovic Three import rules:
Two import rules (
One import rule (it took all time, previously divided between other rules):
No import rules:
Seems like it's exactly module dependency graph is what became slow, just as you mentioned. |
Tried adding issue to |
More to the point, eslint-plugin-import hasn't changed how it builds up its ExportMap in many many years, so if it suddenly got slower in eslint 6, I'm not sure what we can do to speed it up. |
I can also add ESLint debug log. It's 13 MB, not sure if it can help. |
FYI there is an issue open for separation of bootstrap costs from rule performance: |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
Tell us about your environment
tested on latest versions of 5,6,7
12.18.3
6.14.6
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using?default
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Updated eslint from version 5 to 6 and 7.
What did you expect to happen?
Expected no performance degradation, before update timing looked like this:
What actually happened? Please include the actual, raw output from ESLint.
Actually after update to 6 or 7 version I got insane degradation in eslint import plugin.
Nothing else besides eslint version was changed. Also tried installing latest version of import plugin but go the same picture.
Seems like there is some important change in Eslint 6.0. I looked through release notes but couldn't find the problem yet.
Are you willing to submit a pull request to fix this bug?
No, still not sure what in Elint caused this problem. Help wanted.
The text was updated successfully, but these errors were encountered: