-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
[Bug]: Twice as slow when used as ESLint plugin #6999
Comments
This is expected. ESLint takes time to parse each file before sending the text to the spell checker. ESLint expects all plugins to be single threaded. Meaning all file reads and checks happen serially, slowing everything down. |
I'm not quite sure if this is really expected. ESLint is parsing the source files just one single time and then executes all plugins and rules on the generated AST. All other rules that I use are super fast and it is only ![]() Also the ESLint builtin profile rule performance check shows this: Rule | Time (ms) | Relative
:---------------------------------------|----------:|--------:
@cspell/spellchecker | 10412.607 | 15.7%
@typescript-eslint/no-unsafe-assignment | 7781.353 | 11.7%
@typescript-eslint/no-misused-promises | 7059.576 | 10.6%
import/no-cycle | 6323.470 | 9.5%
prettier/prettier | 4912.290 | 7.4%
@typescript-eslint/no-floating-promises | 4550.338 | 6.9%
import/no-deprecated | 4532.762 | 6.8%
@typescript-eslint/no-unsafe-return | 1984.953 | 3.0%
node/no-restricted-import | 1482.559 | 2.2%
import/extensions | 1313.177 | 2.0% |
Kind of Issue
Runtime - command-line tools
Tool or Library
cspell/eslint-plugin
Version
8.17.5
Supporting Library
Not sure / None
OS
All of them
OS Version
No response
Description
When running cspell as an ESLint plugin it is approximately twice as slow as running it directly from the CLI. Is there any particular reason why and anything we can improve here?
compared to
Steps to Reproduce
Expected Behavior
No response
Additional Information
ESLint configuration:
cspell.json
cspell.config.yaml
Example Repository
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: