xo: Too slow on large projects

Description

I am using XO and Ava in a large project. Both packages are too slow to be used. I never actually tried to let them finish. I usually give up after 10+ minutes. I first thought this might be related to globby: https://github.com/sindresorhus/globby/issues/43

As mentioned in that issue I created a test source that reproduces this issue. The glob targets a folder that exists only once.

I opened a separate issue in Ava. https://github.com/avajs/ava/issues/1418

Test Source

Error Message & Stack Trace

nothing happens

Config

https://github.com/pixelass/ava-xo-test/blob/3f9f228f279804d8634a367f5458f69ffbc7d253/package.json#L35-L41

{
  "xo": {
    "ignores": [
      "node_modules/*"
    ],
    "rules": {
      "import/no-unassigned-import": 0
    }
  }
}

Command-Line Arguments

https://github.com/pixelass/ava-xo-test/blob/3f9f228f279804d8634a367f5458f69ffbc7d253/package.json#L10

{
"scripts": {
    "xo": "xo --quiet './**/*.js'"
  },
}
xo --quiet './**/*.js

Relevant Links

Minimal reproduction:
https://github.com/pixelass/ava-xo-test/

Environment

OS X 10.12.5 (16F73)  
Node 6.11.0  

Requested log:

Platform: darwin 16.6.0
xo: 0.18.2
node: 6.11.0
npm: 3.10.10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 28 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I discovered the main culprit. We didn’t define quiet as a boolean, which made the glob pattern an argument to --quiet and not an actuall pattern, which resulted in XO using its default pattern, which is **/*.

Try changing it to:

- "xo": "xo --quiet './**/*.js'",
+ "xo": "xo './**/*.js' --quiet",

Please close issue

@pixelass @SamVerschueren @OmgImAlexis @niftylettuce we released a new version of XO with improved performances regarding globbing. That would be great to have your feedback, as you experienced performance issues on your projects before. Is the new version improve the situation? Do you still experience unreasonable slowness?

@OmgImAlexis a lot has been done to improve performances since you opened #212, including changes in globby.

@niftylettuce, @OmgImAlexis any comments need to include:

  • Actual time measured to lint (as in an actual number)
  • The files linted, or a link or to it, or even better a link to the repo (as in “the actual file so I can reproduce”, not “600 LOC” or some vague info)
  • If possible, a comparison with ESlint with the same rules

Every comments with vague things like "incredibly poor performance” or “multiple different projects in multiple configs” or references to 2 years old things are not helpful and doesn’t allow us to analyze anything.

After deleting the cache:

Eslint: 14s XO: 59s