You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investigating the performance of our linter setup, I ran a TIMING=1 type performance scan of my linter rules, and found that unfortunately, when any of the used rules needs an import map, it will look like the first rule who uses it, takes 90+% of the work. Example:
eslint-plugin-import seems to suffer from this most, in fact, when I disable all import/* rules, the above issue goes away: the time spent between rules is more balanced. Example:
Discussing with the ESLint maintainers how I might overcome the misbalance in reported time spent, one notable statement came back regarding eslint-plugin-import:
Overall, eslint-plugin-import rules always try to resolve every import even when they don't need to (looking at you, no-unused-imports), and that is, in fact, what makes them slow. The maintainers seem to think that other plugins/rules will prepopulate the import map for them, but that's just not the case in the current ecosystem.
Would you say this is accurate? Could the the rules who don't need the import map, be made not to trigger the building of one? Or the other way around? Granted I don't fully understand the implication, or its implications.
The text was updated successfully, but these errors were encountered:
That doesn't sound accurate to me; where was that statement made?
The only thing that populates the export map is one of the rules that uses it, so yes, currently any usage of these rules will cause one of them to be very slow (because eslint lacks a "prep" stage/phase where this could be done when needed).
The rules that do not need the export map already do not trigger the building of one.
Hi,
While investigating the performance of our linter setup, I ran a
TIMING=1
type performance scan of my linter rules, and found that unfortunately, when any of the used rules needs an import map, it will look like the first rule who uses it, takes 90+% of the work. Example:eslint-plugin-import
seems to suffer from this most, in fact, when I disable allimport/*
rules, the above issue goes away: the time spent between rules is more balanced. Example:Discussing with the ESLint maintainers how I might overcome the misbalance in reported time spent, one notable statement came back regarding
eslint-plugin-import
:Would you say this is accurate? Could the the rules who don't need the import map, be made not to trigger the building of one? Or the other way around? Granted I don't fully understand the implication, or its implications.
The text was updated successfully, but these errors were encountered: