What the heck is the event loop anyway?
summary
Explains that V8 only provides heap and call stack and V8 has no setTimeout or DOM APIs, shows how the browser’s web APIs run outside V8 and push callbacks to a task queue, demonstrates the event loop’s single job: pull the next task when the stack is empty, uses a live visualiser called loop, reproduces setTimeout(0) behavior, AJAX callbacks, and how long synchronous work blocks rendering and floods the queue.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:31The Event Loop
- 4:15Javascript Is a Single-Threaded Program
- 7:21What Happens When Things Are Slow
- 9:01Running Code in Browsers
- 11:09Asynchronous Callbacks
- 11:57Javascript Can Only Do One Thing at Time
- 13:58Task Queue
- 20:18Callbacks
- 22:23Simulate the Repaint or the Render in the Browser
- 24:47Scroll Handlers
related talks
41mThe Eventloop in JavaScript - How does it work?
18mEvent loop and asynchrony in JavaScript
39mV8 — Inside Asynchrony and OS Interactions
21mFurther Adventures of the Event Loop
31mThe Event Loop Fairytale
38mJavaScript VM internals, EventLoop, Async and ScopeChains
35mIn the loop
27mDon't block the event loop!JavaScript Async for Effortless UX
