-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dramatic performance regression in import/no-cycle #1943
Comments
I'm happy to raise a PR for this.
…On Thu, 12 Nov 2020, 2:52 pm Michael, ***@***.***> wrote:
We experienced a large performance regression in our linting after
upgrading to 2.22.0 from 2.20.1.
Running linting on a single file.
Before upgrade:
Rule | Time (ms) | Relative
:-----------------------------------|----------:|--------:
import/no-cycle | 3382.383 | 91.2%
...
After upgrade:
Rule | Time (ms) | Relative
:----------------------------------------|----------:|--------:
import/no-cycle | 73731.106 | 99.3%
...
I narrowed the problem down to this PR #1689
<#1689>. The
isEsModuleInterop function tries to load a tsconfig file from disk and
doesn't cache the result. The function is called for each file that is
parsed by the plugin and is called multiple times in the same file. This is
particularly bad when running import/no-cycle over a file with a large
dependency graph as lots of files end up being parsed.
The fix would be to only lookup tsconfig once and cache the result.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1943>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARAYSWWFUNCIFTEAIEFUE3SPNLYZANCNFSM4TSYQ4CQ>
.
|
ljharb
pushed a commit
to Blasz/eslint-plugin-import
that referenced
this issue
Jan 21, 2021
ljharb
pushed a commit
to Blasz/eslint-plugin-import
that referenced
this issue
Jan 21, 2021
ljharb
pushed a commit
to Blasz/eslint-plugin-import
that referenced
this issue
Jan 21, 2021
Here's an idea for how to make |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We experienced a large performance regression in our linting after upgrading to
2.22.0
from2.20.1
.Running linting on a single file.
Before upgrade:
After upgrade:
I narrowed the problem down to this PR #1689. The
isEsModuleInterop
function tries to load a tsconfig file from disk and doesn't cache the result. The function is called for each file that is parsed by the plugin and is called multiple times in the same file. This is particularly bad when runningimport/no-cycle
over a file with a large dependency graph as lots of files end up being parsed.The fix would be to only lookup tsconfig once and cache the result.
The text was updated successfully, but these errors were encountered: