Skip to content

Conversation

@MylesBorins
Copy link
Contributor

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

lib, tools, test, streams

Description of change

This is a backport of a number of commits that remove the use of let in for loop declarations.

It starts with #8873 that removes all instances of let, followed by #9171 to fix a regression introduced in streams, and finally #9049 which adds a linting rule to avoid regressing.

These changes have been living on v6.x and v7.x for a while and did show a decent improvement in performance. I would imagine it will only be more noticeable for v4.x. If anyone from @nodejs/benchmarking wants to chime in here that would be awesome

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory. v4.x labels Nov 11, 2016
Myles Borinsand others added 4 commits November 11, 2016 15:20
This is a known de-opt. It may not be 100% necessary in all cases but it seems like a decent enough idea to avoid it. Ref: nodejs#9553 PR-URL: nodejs#8873 Reviewed-By: Brian White <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Since 2e568d9 there is a bug where unpiping a stream from a readable stream that has `_readableState.pipesCount > 1` will cause it to remove the first stream in the `_.readableState.pipes` array no matter where in the list the `dest` stream was. This patch corrects that problem. Ref: nodejs#9553 PR-URL: nodejs#9171Fixes: nodejs#9170 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Since 2e568d9 there is a bug where unpiping a stream from a readable stream that has `_readableState.pipesCount > 1` will cause it to remove the first stream in the `_.readableState.pipes` array no matter where in the list the `dest` stream was. Ref: nodejs#9553 PR-URL: nodejs#9171 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Myles Borins <[email protected]>
This adds a new ESLint tool to check for let declarations within the for, forIn, forOf expressions. Fixes: nodejs#9045 Ref: nodejs#9553 Ref: nodejs#8873 PR-URL: nodejs#9049 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: James M Snell <[email protected]>
@MylesBorinsMylesBorins added stream Issues and PRs related to the stream subsystem. test Issues and PRs related to the tests. lib / src Issues and PRs related to general changes in the lib or src directory. and removed lib / src Issues and PRs related to general changes in the lib or src directory. labels Nov 11, 2016
@MylesBorinsMylesBorins changed the title Backport let in for loop Backport removing let in for loop declarationNov 11, 2016
@MylesBorins
Copy link
ContributorAuthor

Copy link
Member

@addaleaxaddaleax left a comment

Choose a reason for hiding this comment

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

LGTM

MylesBorins pushed a commit that referenced this pull request Nov 14, 2016
This is a known de-opt. It may not be 100% necessary in all cases but it seems like a decent enough idea to avoid it. Ref: #9553 PR-URL: #8873 Reviewed-By: Brian White <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 14, 2016
Since 2e568d9 there is a bug where unpiping a stream from a readable stream that has `_readableState.pipesCount > 1` will cause it to remove the first stream in the `_.readableState.pipes` array no matter where in the list the `dest` stream was. This patch corrects that problem. Ref: #9553 PR-URL: #9171Fixes: #9170 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Myles Borins <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 14, 2016
Since 2e568d9 there is a bug where unpiping a stream from a readable stream that has `_readableState.pipesCount > 1` will cause it to remove the first stream in the `_.readableState.pipes` array no matter where in the list the `dest` stream was. Ref: #9553 PR-URL: #9171 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Myles Borins <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 14, 2016
This adds a new ESLint tool to check for let declarations within the for, forIn, forOf expressions. Fixes: #9045 Ref: #9553 Ref: #8873 PR-URL: #9049 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: James M Snell <[email protected]>
@MylesBorins
Copy link
ContributorAuthor

landed in 84849f1...c8dccf2

@MylesBorinsMylesBorins deleted the no-let-in-loops branch November 14, 2017 17:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / srcIssues and PRs related to general changes in the lib or src directory.streamIssues and PRs related to the stream subsystem.testIssues and PRs related to the tests.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@MylesBorins@addaleax@nodejs-github-bot@jalafel