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

victor-homyakov commented Oct 9, 2019

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

This comment has been minimized.

Copy link

jsf-clabot commented Oct 9, 2019

CLA assistant check
All committers have signed the CLA.

@eslint eslint bot added the triage label Oct 9, 2019
Copy link
Member

platinumazure left a comment

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

This comment has been minimized.

Copy link
Member

platinumazure commented Oct 9, 2019

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 left a comment

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

@platinumazure

This comment has been minimized.

Copy link
Member

platinumazure commented Oct 9, 2019

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

@victor-homyakov victor-homyakov force-pushed the victor-homyakov:debug-show-plugin-require-time branch from 01dc24b to ad9c276 Oct 10, 2019
Copy link
Member

g-plane left a comment

LGTM, thanks!

@platinumazure platinumazure added accepted and removed evaluating labels Oct 20, 2019
@platinumazure

This comment has been minimized.

Copy link
Member

platinumazure commented Oct 20, 2019

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.

@platinumazure platinumazure merged commit 364877b into eslint:master Oct 25, 2019
16 checks passed
16 checks passed
Verify Files
Details
Test (ubuntu-latest, 8.x) Test (ubuntu-latest, 8.x)
Details
Test (ubuntu-latest, 10.x) Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 12.x) Test (ubuntu-latest, 12.x)
Details
Test (windows-latest, 12.x) Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x) Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message Commit message follows guidelines
Details
continuous-integration Build #20191010.1 succeeded
Details
continuous-integration (Test on Node.js 10 (Linux)) Test on Node.js 10 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Linux)) Test on Node.js 12 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Windows)) Test on Node.js 12 (Windows) succeeded
Details
continuous-integration (Test on Node.js 12 (macOS)) Test on Node.js 12 (macOS) succeeded
Details
continuous-integration (Test on Node.js 8 (Linux)) Test on Node.js 8 (Linux) succeeded
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@victor-homyakov victor-homyakov deleted the victor-homyakov:debug-show-plugin-require-time branch Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.