~/talk

The event loop fairytale

Talkat jsday 2024 · 2024-04-11..04-12· [javascript]
slides:none on file

A concrete map of Node.js internals: callbacks pass through named event loop phases, CPU/IO offloads to libuv elves backed by a default thread pool (4 threads), promises and process.nextTick run as microtasks after each phase, and timers vs setImmediate behave in their specific phases (setImmediate is not actually immediate). A synchronous 2MB file read blocks the loop for a long time; worker threads or libuv offload prevent that.

AI-written summary · about

  1. 0:00Event loop fairytale
  2. 1:08Why it matters
  3. 2:10Block and early kingdoms
  4. 4:36Land of promises
  5. 6:41Villagers in promises
  6. 8:05Sir Kastak and Fairy
  7. 10:16Never block the thread
  8. 12:44Desert of asynchrony
  9. 14:11Thread pools and libuv
  10. 17:23Callbacks return to stack
  11. 19:13Menacing dragon of blocks
  12. 20:37Six phases of event loop
  13. 23:45Power of process.nextTick
  14. 25:30Why some phases matter more than others
  15. 26:36Event loop challenge
  16. 27:20Strength in mind and time
  17. 28:03Birdie and tech for good
  18. 29:10Goang threads and conclusion
  19. 30:36Questions and answers session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.