~/talk

Broken Promises

Talkat Node+JS Interactive 2019 · 2019-12-11..12-12· [nodejs, javascript]
slides:none on file

Performance audits show Node apps allocating thousands of promises in synchronous code paths, for example a case that creates 30,000 promises during a 30 second benchmark and a demo that allocates 8,000 promises inside a loop, which blocks the event loop and drops throughput to 4 requests per second. Errors become unhandled rejections, file descriptors leak, long .then chains (15–16 deep) and mixing callbacks with promises break error propagation. Use trace events/Chrome tracing, util.promisify, avoid promises in tight loops, and prefer Promise.all only when you accept continuing background work.

AI-written summary · about

  1. 0:00Introduction
  2. 2:00Promises are powerful
  3. 4:02Set Interval
  4. 11:00Async Promises
  5. 12:40Unhandled Rejection
  6. 14:30Mixing Promises
  7. 20:20Chaining
  8. 22:35Async Functions
  9. 23:20Resolve Promises
  10. 24:00Loops
  11. 26:20Promises
~/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.