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

various fix in lib #26562

Closed
wants to merge 3 commits into from
Closed

Conversation

gengjiawen
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. repl Issues and PRs related to the REPL subsystem. url Issues and PRs related to the legacy built-in url module. labels Mar 10, 2019
socket.cork();
let ret;
for (var i = 0; i < outputLength; i++) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I change var to let in my first try. But I got

/home/travis/build/nodejs/node/lib/_http_outgoing.js
  802:8  error  Use of `let` as the loop variable in a for-loop is not recommended. Please use `var` instead  node-core/no-let-in-for-declaration

Can we remove this rule in master branch ?
cc @BridgeAR @Trott

Copy link
Member

Choose a reason for hiding this comment

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

It has been two years since #8637 (when using let/const lost performance), and let/const performance in V8 was improved due to #8637 (comment) and #9729 (comment)

I think maybe it's time to remove this rule now ?

Copy link
Member

@Trott Trott Mar 10, 2019

Choose a reason for hiding this comment

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

That rule was instituted because using let with a for loop that way could be drastically slower than using var. The problem was fixed in V8 6.0.

This performance problem still exists in Node.js 6.x (which ships with V8 5.1). Since code that lands on the master branch can be backported to 6.x, the rule remains in place. Support for 6.x ends this June, so starting in July, we can disable the rule. At that time, the oldest supported Node.js version will be 8.x, which currently ships with V8 6.2.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or start a pr and add the label don't land on 6.x ?

Copy link
Member

Choose a reason for hiding this comment

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

6.x is in maintenance. I think we can already disable the rule.

lib/url.js Show resolved Hide resolved
@BridgeAR
Copy link
Member

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 10, 2019
@danbev
Copy link
Contributor

danbev commented Mar 15, 2019

Landed in 2788fd6, ccdaa43, and 169b7f1.

@danbev danbev closed this Mar 15, 2019
pull bot pushed a commit to Rachelmorrell/node that referenced this pull request Mar 15, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pull bot pushed a commit to Rachelmorrell/node that referenced this pull request Mar 15, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pull bot pushed a commit to Rachelmorrell/node that referenced this pull request Mar 15, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
PR-URL: #26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
PR-URL: #26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
PR-URL: #26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem. repl Issues and PRs related to the REPL subsystem. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants