Leveraging the Event Loop for Blazing-Fast Apps!
summary
Claims that the Microtask Queue can yield huge speedups and demonstrates it by building a super simple signal (class-based DOM binder), benchmarking millions of updates and switching rendering from immediate to queued. Uses setTimeout(0) versus window.queueMicrotask / Promise.resolve to show the microtask path cuts a 3.8s loop to about 61ms — roughly a 50x improvement. Explains run-to-completion, why timeouts aren’t guaranteed, and when microtasks can instead create their own blocking loop.
AI-written summary · about
chapters (14)
- 0:00Welcome
- 1:49JavaScript event loop
- 3:55JavaScript runtimes
- 7:26Event loop and non-blocking I/O
- 10:13Run to completion and concurrency
- 12:40Timeouts and timestamp checks
- 13:43Blocking vs non-blocking demo
- 17:17Demo scaffolding
- 23:37Benchmarking signals
- 26:45Optimizing with microtasks
- 29:15Performance results
- 31:05When to use microtasks
- 34:18Summary
- 35:43Q&A
related talks
27mDon't block the event loop!JavaScript Async for Effortless UX
41mThe Eventloop in JavaScript - How does it work?
34mJavaScript's Secret Life Between the Ticks
18mEvent loop and asynchrony in JavaScript
27mWhen JavaScript takes its coffee break?
21mFurther Adventures of the Event Loop
35mIn the loop
23mAsync JS
