Open tjx666 opened 1 year ago
I have the same problem :(
Rule | Time (ms) | Relative
:---------------------------------|----------:|--------:
import/no-duplicates | 72224.446 | 63.4%
import/default | 31071.649 | 27.3%
indent | 2149.804 | 1.9%
no-imports/outside-special-folder | 2124.553 | 1.9%
import/no-unresolved | 1399.763 | 1.2%
react/no-direct-mutation-state | 600.695 | 0.5%
import/export | 268.659 | 0.2%
import/no-named-as-default-member | 251.551 | 0.2%
react/no-typos | 230.053 | 0.2%
react/require-render-return | 205.671 | 0.2%
and if you comment out no-duplicates, what happens to the other import rules?
It might not a problem about a specific rule.
For our project, import/extensions
is extremely slow consitently.
Rule | Time (ms) | Relative
:------------------------------------|-----------:|--------:
import/extensions | 103423.841 | 64.9%
import/no-extraneous-dependencies | 19748.530 | 12.4%
import/no-cycle | 14308.905 | 9.0%
import/order | 2371.498 | 1.5%
import/no-relative-packages | 1831.405 | 1.1%
@typescript-eslint/naming-convention | 1697.527 | 1.1%
react/no-unstable-nested-components | 1021.375 | 0.6%
react/function-component-definition | 915.998 | 0.6%
import/no-unresolved | 685.094 | 0.4%
react/prefer-stateless-function | 638.503 | 0.4%
However, when I turn off import/extensions
as https://github.com/import-js/eslint-plugin-import/issues/2746#issuecomment-1654483023 suggests, another rule get extremely slow.
Rule | Time (ms) | Relative
:------------------------------------|-----------:|--------:
import/no-extraneous-dependencies | 114140.980 | 77.9%
import/no-cycle | 12257.164 | 8.4%
import/order | 2212.973 | 1.5%
import/no-relative-packages | 1627.329 | 1.1%
@typescript-eslint/naming-convention | 1573.758 | 1.1%
react/no-unstable-nested-components | 963.062 | 0.7%
react/function-component-definition | 809.087 | 0.6%
import/no-unresolved | 678.688 | 0.5%
react/prefer-stateless-function | 608.823 | 0.4%
react/static-property-placement | 557.109 | 0.4%
I don't know plugin-import internal but I'm suspicous of something like common setup.
Related to ExportMap performance?
But no-duplicates doesn't use ExportMap does it?
true, but it does invoke the resolver, which in turn uses the ModuleCache, so maybe that's the problem.
code:
Versions: