eslint: Performance: ESLint is slow

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.

About this issue

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

Commits related to this issue

Most upvoted 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.