Wait, react is multi-threaded?
summary
Shows that heavy CPU work (sorting 10,000–50,000 items with a bubble sort) moves off the main thread using web workers, so the React UI stays responsive and the spinner keeps animating; profiler shows a 5.71s main-thread task disappears and a separate worker thread does the sorting. Demonstrates wiring with a promise-based helper (Chrome link / use webworker hook), explains why Concurrent mode yields cooperative concurrency while workers give true parallelism across CPU cores within the 16ms frame budget.
AI-written summary · about
chapters (11)
- 0:00Introduction and context
- 1:18The importance of UX
- 2:46Demonstrating performance issues
- 4:48Browser rendering pipeline
- 8:16Introducing web workers
- 10:37Concurrent mode vs parallelism
- 12:35JavaScript threading explained
- 14:28Simplifying worker API
- 18:09Final demo and profiling
- 21:16Use cases and limitations
- 24:02Conclusion and Q&A
