Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
doc: add explanation why keep var with for loop in async_hooks#30380
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
lrecknagel commented Nov 12, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Refs: nceu19-async_hooks This comment will help contributors to understand why keeping var
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 " |
mcollina commented Nov 12, 2019
This is an extremely tight loop in a code path that is hit a lot. |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Trott commented Nov 12, 2019
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Trott commented Nov 12, 2019
I left two optional suggestions. It will save someone a little bit of |
nodejs-github-bot commented Nov 14, 2019
nodejs-github-bot commented Nov 26, 2019
gireeshpunathil commented Nov 26, 2019
This comment will help contributors to understand why keeping var PR-URL: #30380 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
gireeshpunathil commented Nov 26, 2019
landed in 4506991 |
This comment will help contributors to understand why keeping var PR-URL: #30380 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
This comment will help contributors to understand why keeping var PR-URL: #30380 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
This comment will help contributors to understand why keeping var PR-URL: #30380 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Aschen commented Jul 18, 2022
👋 Just passing by here and I was curious so I ran some benchmarks if anyone is curious about this. At the time of Node.js 6 it was a real performance gain but nowadays it's almost the same |

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), orvcbuild test(Windows) passes