import/no-cycle
, import/namespace
and import/no-deprecated
speed regression when switching from legacy config to flat config
#3148
Labels
Possible duplicate of #3113.
I'm using using eslint-plugin-import v2.31.0 and eslint v8.57.1.
I've got a large work project that I'm attempting to migrate from a legacy-style config to a flat config in preparation for an eventual eslint 9 update. Unfortunately it's private and ~6000 files so I can't easily publicly reproduce.
I've found that switching the legacy config to a flat config radically increases the amount of time
no-cycle
takes to complete. I am already settingdisableScc: true
.In order to try to isolate this issue I've tried to create a minimal pair of configs - one in the legacy format, one in the flat format that only runs the no-cycle rule.
eslint-legacy-nocycle.cjs
eslint-flat-nocycle.js
Running these two configs over the full repository sees the flat config take about triple the time of the legacy config:
This 3x increase is somewhat suprising to me. When I try i use my legacy config with no-cycle enabled it completes in ~2m30s, while when trying to run the flat config version I give up waiting for eslint to complete after 20 minutes - with a fuller config no-cycle seems to take 10x as long.
(ignore the
jest/expect-expect
some random file in the repo turns that rule on in an in-file directive)When testing using my full config (with no-cycle disabled) I also saw
import/namespace
andimport/no-deprecated
regress also.import/no-deprecated
with a legacy config took 0.8s, with a flat config it took 10.2simport/namespace
with a legacy config took 11.2s, with a flat config it took 18.3sAs this time regression hurts no-cycle, namespace and no-deprecated, I suspect that this might be something to do with the ExportMapBuilder. I saw that ab0941e makes the cache key used in the ExportMap be constructed differently depending on if a legacy or flat config is used.
I'm not sure how to further debug this to try to isolate the change further. Any thoughts on how I might do so would be appreciated.
The text was updated successfully, but these errors were encountered: