question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance: ESLint is slow

See original GitHub issue

I’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:

  1. To attach comments
  2. To determine token ranges
  3. For escope
  4. The primary traversal that applies our rules

We need to start figuring this out.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:35 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Feb 2, 2014

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.

0reactions
nzakascommented, Apr 17, 2014

Closing this out as we have made some great improvements.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found