Parsing Svelte files with types is slow, and slows down more as more files are added to project #1084
Open
2 tasks done
Labels
perf
Improvement of performance
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
9.21.0
What version of
eslint-plugin-svelte
are you using?3.0.0-next.18
What did you do?
Configuration
What did you expect to happen?
With type-checking enabled, and without any lint rules enabled, linting a Svelte file should take about the same amount of time as linting a TypeScript file. Lint times should be roughly on par with type-checking times.
What actually happened?
When types are enabled, the linting time of Svelte components increases dramatically as the number of files in the project (Svelte or otherwise) increase. This occurs with both
projectService: true
andproject: './tsconfig.json'
. This lint increase occurs even if the ESLint config doesn't enable any rules. The performance issue appears to happen during the parse stage.In a simple project with 1000 Svelte files and 1000 TS files, and the ESLint config above (parsers configured, no rules enabled), my type-checking / lint times are:
svelte-check
)projectService
projectService
project
In a closed-source real-life project that I work on, linting our TS files takes under a minute, while linting the Svelte files takes 5 to 8 minutes depending on the machine.
Link to GitHub Repo with Minimal Reproducible Example
I've created a reproduction repository with a few simple ESLint configs that configure the TS and Svelte parsers and nothing else, along with a script to create fixture components and modules:
https://github.com/mcous/eslint-svelte-ts-perf
Additional comments
Thanks for all your work on this project! I'm very happy to dedicate time and energy to investigating this issue further, but I'd need some guidance to do so.
I think this issue may be related to #954
The text was updated successfully, but these errors were encountered: