You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation: performance warning about timeout.unref() is not clear. #42239
The documentation for timeout.unref() ends with this warning:
Calling timeout.unref() creates an internal timer that will wake the Node.js event loop. Creating too many of these can adversely impact performance of the Node.js application.
I don't understand what this means.
"creates an internal timer that will wake the Node.js event loop" sounds roughly like what setTimeout does. Is it different?
Tangent: I also noticed that the docs for the new timersPromises.setInterval (link) supports the ref parameter but there's no similar warning there.
Activity
Trott commentedon Mar 7, 2022
@nodejs/timers
meixg commentedon Mar 7, 2022
It had been added for a long time: bdd1a74
Maybe we need to check its current status.
meixg commentedon Mar 7, 2022
I checked the code in v0.9.1, there is indeed a
new Timerprocess:node/lib/timers.js
Lines 254 to 267 in e6ce259
But this is not the case now.
doc: remove outdated timeout.unref content
doc: remove outdated timeout.unref content
doc: remove outdated timeout.unref content
doc: remove outdated timeout.unref content
doc: remove outdated timeout.unref content