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

doc: add explanation why keep var with for loop in async_hooks #30380

Closed
wants to merge 1 commit into from

Conversation

@lrecknagel
Copy link
Contributor

lrecknagel commented Nov 12, 2019

Refs: nceu19-async_hooks

This comment will help contributors to understand why keeping var in some for loop instead changing at to let, as discussed with @mcollina

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Refs: nceu19-async_hooks

This comment will help contributors to understand why keeping var
@Trott

This comment has been minimized.

Copy link
Member

Trott commented Nov 12, 2019

Welcome, @lrecknagel and thanks for the pull request. I'm guessing this is from a Code + Learn event. I'm not sure the "let inside a loop is much slower than var" thing is true anymore in current V8. /ping @nodejs/v8

@mcollina

This comment has been minimized.

Copy link
Member

mcollina commented Nov 12, 2019

This is an extremely tight loop in a code path that is hit a lot.
This is still true on Node 10 and it would mean that we would not be able to backport this change.
Given that this is a cosmetic change that might cause issues, I prefer to not change them.

Copy link
Member

mcollina left a comment

LGTM

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Nov 12, 2019

This is an extremely tight loop in a code path that is hit a lot.
This is still true on Node 10 and it would mean that we would not be able to backport this change.
Given that this is a cosmetic change that might cause issues, I prefer to not change them.

Cool. Let's see if we can get that information into the comment. As it reads now, it could encourage someone to go through and change all let in loops to var throughout core.

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Nov 12, 2019

I left two optional suggestions. It will save someone a little bit of git blame archaeology should these lines get moved around, edited, etc. But totally optional. Thanks.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@gireeshpunathil

This comment has been minimized.

Copy link
Member

gireeshpunathil commented Nov 26, 2019

the windows failure sequential/test-inspector-contexts is known as in #30519

the windows failure parallel/test-inspector-wait-for-connection is known as in #30619

the linux containerized failure parallel/test-readline-async-iterators-destroy is reported #30660

gireeshpunathil added a commit that referenced this pull request Nov 26, 2019
This comment will help contributors to understand why keeping var
PR-URL: #30380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@gireeshpunathil

This comment has been minimized.

Copy link
Member

gireeshpunathil commented Nov 26, 2019

landed in 4506991

addaleax added a commit that referenced this pull request Nov 30, 2019
This comment will help contributors to understand why keeping var
PR-URL: #30380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
targos added a commit that referenced this pull request Dec 1, 2019
This comment will help contributors to understand why keeping var
PR-URL: #30380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@BridgeAR BridgeAR mentioned this pull request Dec 3, 2019
@BethGriggs BethGriggs mentioned this pull request Dec 9, 2019
MylesBorins added a commit that referenced this pull request Dec 17, 2019
This comment will help contributors to understand why keeping var
PR-URL: #30380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@BethGriggs BethGriggs mentioned this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.