Skip to content
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

Update: measure plugin loading time and output in debug message #12395

Merged

Conversation

victor-homyakov
Copy link
Contributor

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:

What changes did you make? (Give an overview)
I've added measurement of loading time for each plugin. Times are shown in debug output.

The reason is in unexpectedly significant startup time for some plugins, even when there is nothing to check for them. One possible example:

  • ESLint configuration has typescript-eslint plugin added
  • pre-commit hook is configured to run ESLint on modified files
  • the commit does not contain .ts files (only .js, so ESLint is still launched, but there is nothing for typescript-eslint to check)

In this example typescript-eslint plugin is still loaded and consumes more than half a second to load typescript-eslint/typescript-eslint#1040

More examples:

So in case you added these four plugins, ESLint will require 1.5s to start. It's significant for both CLI tools and for pre-commit hooks. I'd like to know exact timings in order to tune ESLint configuration (pre-commit hook may have the fastest one, CI configuration should have the slowest one).

Is there anything you'd like reviewers to focus on?

@jsf-clabot
Copy link

jsf-clabot commented Oct 9, 2019

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Oct 9, 2019
Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

We usually ask for an RFC before most core changes, but I think this is trivial enough that we shouldn't need one here. But let's see what other team members think.

@platinumazure
Copy link
Member

I should qualify: This looks good, outside of the CLA check. Please let us know if you run into issues while fixing the commits to allow the CLA check to pass. Thanks!

Copy link
Member

@ilyavolodin ilyavolodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I don't think we need RFC for this.

@platinumazure platinumazure added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Oct 9, 2019
@platinumazure
Copy link
Member

Marking as "evaluating" for now, but we can change to "accept" if nobody from the team objects to this change.

Copy link
Member

@g-plane g-plane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 20, 2019
@platinumazure
Copy link
Member

I'm marking this as "accepted", since the team has had plenty of time to review and there is no objection so far. I'll leave this open for another day or so, and then merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants