-
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
timers: remove redundant unref calls #38320
timers: remove redundant unref calls #38320
Conversation
Hey @jasnell, thanks for the quick review. I have a question tho. Does my change actually change something other than a redundant call (and state changes)? I tried looking around, but I couldn't find a reason for it to be actually meaningful 🧐 (other than of course not doing something redundant). |
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 but we probably need a perf benchmark. Will start one in a moment.
No significant changes in benchmark performance. |
PR-URL: nodejs#38320 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
63c6270
to
d9b56fe
Compare
Landed in d9b56fe |
PR-URL: #38320 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Remove redundant calls to
Timeout.unref()
by passing theref: boolean
parameter oftimers/promises#setTimeout
andtimers/promises#setInterval
directly toTimeout
constructor'sisRefed
parameter.Note: possible expansion of this PR is to apply the same
isRefed
parameter from
Timeout
toImmediate
to prevent the same redundantImmediate.unref()
call intimers/promises#setImmediate
.