Skip to content

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 <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@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 <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@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