Performance: ESLint is slow
See original GitHub issueI’d like to get some better information about why ESLint is so much slower than JSHint.
I added a perf test to the build, that can be run like this:
node Makefile.js perf
It runs ESLint over jshint.js. Currently it takes over 3 seconds for this test to complete. When I run JSHint on itself, it takes less than 0.5 seconds, meaning that we are six times as slow. JSCS takes just about the same as JSHint.
My hunch as to why we’re six times slower is that we’re doing multiple traversals of the AST:
- To attach comments
- To determine token ranges
- For escope
- The primary traversal that applies our rules
We need to start figuring this out.
Issue Analytics
- State:
- Created 10 years ago
- Comments:35 (25 by maintainers)
Top Results From Across the Web
Why typescript-eslint Performance is Slow - Duncan Leung
Problem: Slow Lint Run Process While setting up our team's ESLint config with TypeScript, I noticed that running ESLint with typescript-eslint ...
Read more >Bug: eslint is running slow when giant files such as typescript ...
eslint is taking almost 2 minutes to lint half a dozen files, none of which are big. In the debug log (posted below),...
Read more >Which eslint rules in my config are slow? - Stack Overflow
eslint shows the spent times of rules if the environment variable TIMING is set. For example: $ TIMING=1 eslint lib Rule | Time...
Read more >Speeding Up ESLint - Medium
Today, I happened to notice that on my project of 8 files, it's equally slow with the whole project as it is with...
Read more >How to find the type that is causing performance issues in ...
It's not an extension or ESLint issue, I already disabled them all. The project is kinda new, ~10k lines, so it shouldn't be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup. Ironic because that’s exactly the pull request I made to Esprima: https://github.com/ariya/esprima/pull/192
I’m going to follow up and see what it will take to get that change in.
Closing this out as we have made some great improvements.