import-js / import-js/eslint-plugin-import

Even larger `import/no-cycle` performance downgrade in 2.30.0

Open
#3,047 16 comments 9 reactions 0 assignees View on GitHub
performance
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

#2348 was supposed to get fixed in 2.30.0, but for my project the performance of `import/no-cycle` got even worse.

With 2.29.1 it took 21s:
```
Rule | Time (ms) | Relative
:---------------------------------------|----------:|--------:
import/no-cycle | 21503.212 | 52.9%
```

With 2.30.0 it took 67s, 3.2 times slower:
```
Rule | Time (ms) | Relative
:---------------------------------------|----------:|--------:
import/no-cycle | 67440.935 | 76.8%
```

I also tried `'import/no-cycle': [2, { ignoreExternal: false, maxDepth: 3 }],`, which was suggested in the previous ticket, but that made no performance difference. It did find more errors though.

Are there other measurements I can share? Like a cpu profile? I'm not sure what's useful here and didn't find good clues in #2348.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `import/no-cycle` timings with versions 2.29.1 and 2.30.0, using the reported `maxDepth` and `ignoreExternal` settings. Read issue #2348 and inspect the `import/no-cycle` rule entry point to identify the regression. Done means locating and correcting the slowdown, with measurements showing performance no worse than the prior version.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.