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
import/no-extraneous-dependencies and import/order pretty slow #1793
Comments
This is because the first (I'd suggest using jest-runner-eslint for a large codebase; the parallelization helps a lot) |
@ljharb bringing this back - setting aside |
@osdiab it doesn't need the entire graph, but it does need to know what kind of import each thing is, which requires some of the ExportMap to be built up. There might be a way to only partially traverse in the |
I just ran into this issue today as well. Our project has the following timings:
The total time taken can be extrapolated to be around 86 seconds (
The total time is now extrapolated as around 62 seconds, which is only a 2 seconds difference from the first set of timings, sans the first two rules. Therefor, I can conclude that, within a margin of error, disabling one or more import rules almost entirely subtracts their time taken from the duration of the lint command. And if I may, this means the whole discussion about dependency graph being constructed, while certainly not invalid, might be turn out to be only a tiny fraction of the time taken up by the rules that appear to be the slowest. So, not really a factor in why those rules are slow - They are indeed slow, but not because of dependency graph. But I love to be corrected if anyone has proof to the contrary. That's what science is all about 😀 |
This comment has been minimized.
This comment has been minimized.
So I'm bringing this back - i have a slightly different proposal. For my project I only really care about three groups - code in the current module, code from another project in my monorepo, and all other external code. I'm thinking this rule could be super fast for me if there were a flag or separate rule altogether, such that I could just decide the import group entirely via text pattern matching. For example:
this way the rule wouldn't have to do any dependency analysis. Would something like this be amenable to the maintainers here? |
Performance not great when I use
TIMING=1
witheslint
, I don't know how these particular rules are implemented but if there's low hanging fruit to make them run quicker it'd be a boon for my project.The text was updated successfully, but these errors were encountered: