~/talk

Observing Node.js

Talkat CascadiaJS 2018 · 2018-11-15..11-16· [nodejs, observability]
slides:none on file

Explains why promises often slow Node rather than speed it and shows concrete instrumentation: trace events and async hooks export per-callback lifetimes, and clinic bubbleprof aggregates async latency. Demonstrates that promises and nextTick put handlers into microtask queues, that promise chains can create 15,000 promises and 10,000 nextTicks in a 20 second run, that a synchronous loop created ~1,000 promises which all run back-to-back, and that visual traces reveal where the event loop is blocked.

AI-written summary · about

  1. 0:00Observing Node.js James Snell
  2. 2:57What's happening inside?
  3. 4:42Your Challenge: In what order will the statements be printed?
  4. 5:04Four Critical Concepts
  5. 5:26The Microtask Queue
  6. 8:56The event loop executes only one task at a time.
  7. 9:24When JavaScript is running the Event Loop is not
  8. 9:45Event Loop Delay
  9. 10:11JavaScript is not asynchronous.
  10. 11:01Bootstrap » Main Event Loop
  11. 11:13Bootstrap: Node.js loads it's own JavaScript...
  12. 11:37Main: Node.js loads and executes user code...
  13. 11:52Event Loop: Started after main scope exits...
  14. 13:22First Rule of Node.js Performance: Know when your code is running
  15. 14:20Async Hooks
  16. 14:38Bubble Profiling
  17. 17:02Bootstrap Trace Events
  18. 21:58Trick Question: Are Promises Asynchronous?
~/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.