-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Conversation
Refs: nceu19-async_hooks This comment will help contributors to understand why keeping var
Welcome, @lrecknagel and thanks for the pull request. I'm guessing this is from a Code + Learn event. I'm not sure the " |
This is an extremely tight loop in a code path that is hit a lot. |
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
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 |
I left two optional suggestions. It will save someone a little bit of |
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]>
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]>
👋 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