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

timers: remove redundant unref calls #38320

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

gioragutt
Copy link
Contributor

Remove redundant calls to Timeout.unref() by passing the
ref: boolean parameter of timers/promises#setTimeout and
timers/promises#setInterval directly to Timeout constructor's
isRefed parameter.

Note: possible expansion of this PR is to apply the same isRefed
parameter from Timeout to Immediate to prevent the same redundant
Immediate.unref() call in timers/promises#setImmediate.

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Apr 20, 2021
@gioragutt
Copy link
Contributor Author

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).

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@Trott Trott left a 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.

@Trott
Copy link
Member

Trott commented Apr 24, 2021

@Trott
Copy link
Member

Trott commented Apr 24, 2021

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1014/

No significant changes in benchmark performance.

@nodejs-github-bot
Copy link
Collaborator

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>
@Trott Trott force-pushed the giorag/remove-redundant-unref-calls branch from 63c6270 to d9b56fe Compare April 24, 2021 22:06
@Trott
Copy link
Member

Trott commented Apr 24, 2021

Landed in d9b56fe

@Trott Trott merged commit d9b56fe into nodejs:master Apr 24, 2021
targos pushed a commit that referenced this pull request Apr 29, 2021
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>
@targos targos mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants