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: run rules after node.parent is already set (fixes #9122) #9283

Merged
merged 1 commit into from Sep 15, 2017

Conversation

not-an-aardvark
Copy link
Member

@not-an-aardvark not-an-aardvark commented Sep 10, 2017

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

[x] Add something to the core

What changes did you make? (Give an overview)

This is a reference implementation of #9122. With this change, rules don't have to worry about whether node.parent has been set at any given point, because all of the node.parent properties will be assigned by the time the rule gets run.

This builds on #9268, and should not be merged until #9268 is merged. For now, only look at the second commit.

Since this stores nodes in a queue rather than doing another traversal, this has very little performance impact:

Performance metrics

On 9ecd264 (without this change applied):

((HEAD detached at 7685fed3))$ npm run perf

> eslint@4.6.1 perf /path/to/eslint
> node Makefile.js perf


Loading:
  Load performance Run #1:  120.599158ms
  Load performance Run #2:  114.98305ms
  Load performance Run #3:  114.749014ms
  Load performance Run #4:  119.581881ms
  Load performance Run #5:  120.72974ms

  Load Performance median:  119.581881ms


Single File:
  CPU Speed is 3100 with multiplier 13000000
  Performance Run #1:  5545.881914ms
  Performance Run #2:  5494.320288ms
  Performance Run #3:  5507.513848ms
  Performance Run #4:  5535.386212ms
  Performance Run #5:  5487.6923289999995ms

  Performance budget exceeded: 5507.513848ms (limit: 4193.548387096775ms)


Multi Files (0 files):
  CPU Speed is 3100 with multiplier 39000000
  Performance Run #1:  13472.871353ms
  Performance Run #2:  13794.571958ms
  Performance Run #3:  13790.013038000001ms
  Performance Run #4:  13667.251705ms
  Performance Run #5:  13450.531616ms

  Performance budget exceeded: 13667.251705ms (limit: 12580.645161290322ms)

On deferred-listener-calls (with this change applied):

(deferred-listener-calls)$ npm run perf

> eslint@4.6.1 perf /Users/tkatz/code/eslint
> node Makefile.js perf


Loading:
  Load performance Run #1:  116.02172ms
  Load performance Run #2:  122.795839ms
  Load performance Run #3:  120.586319ms
  Load performance Run #4:  117.875192ms
  Load performance Run #5:  117.937884ms

  Load Performance median:  117.937884ms


Single File:
  CPU Speed is 3100 with multiplier 13000000
  Performance Run #1:  5591.12559ms
  Performance Run #2:  5558.3983530000005ms
  Performance Run #3:  5500.023409ms
  Performance Run #4:  5587.691358ms
  Performance Run #5:  5585.687514ms

  Performance budget exceeded: 5585.687514ms (limit: 4193.548387096775ms)


Multi Files (0 files):
  CPU Speed is 3100 with multiplier 39000000
  Performance Run #1:  13529.686102ms
  Performance Run #2:  13508.945281ms
  Performance Run #3:  13482.570723ms
  Performance Run #4:  13340.607641ms
  Performance Run #5:  13524.828015ms

  Performance budget exceeded: 13508.945281ms (limit: 12580.645161290322ms)

These numbers indicate a 1% performance decrease on the single-file benchmark, and a 1% improvement on the multi-file benchmark. I suspect at least some of this is noise, but if there is a performance impact it seems quite small.

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

Nothing in particular

@not-an-aardvark not-an-aardvark added blocked This change can't be completed until another issue is resolved 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 labels Sep 10, 2017
@mention-bot
Copy link

@not-an-aardvark, thanks for your PR! By analyzing the history of the files in this pull request, we identified @i-ron-y, @mysticatea and @nzakas to be potential reviewers.

@eslintbot
Copy link

LGTM

@eslint eslint deleted a comment from eslintbot Sep 10, 2017
@eslintbot
Copy link

LGTM

@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion and removed blocked This change can't be completed until another issue is resolved evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 11, 2017
@btmills btmills merged commit 1488b51 into master Sep 15, 2017
@not-an-aardvark not-an-aardvark deleted the deferred-listener-calls branch September 15, 2017 19:26
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Sep 18, 2017
ilyavolodin pushed a commit that referenced this pull request Sep 18, 2017
* Revert "4.7.0"

This reverts commit 439e8e6.

* Revert "Build: changelog update for 4.7.0"

This reverts commit 2ec62f9.

* Revert "Upgrade: Espree v3.5.1 (fixes #9153) (#9314)"

This reverts commit 787b78b.

* Revert "Update: run rules after `node.parent` is already set (fixes #9122) (#9283)"

This reverts commit 1488b51.

* Revert "Docs: fix wrong config in max-len example. (#9309)"

This reverts commit 4431d68.

* Revert "Chore: Revert "avoid handling Rules instances in config-validator" (#9295)"

This reverts commit 9d1df92.

* Revert "Docs: Fix code snippet to refer to the correct option (#9313)"

This reverts commit 7d24dde.

* Revert "�Chore: rewrite parseListConfig for a small perf gain. (#9300)"

This reverts commit 12388d4.
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 15, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 15, 2018
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

5 participants