~/talk

How to Use Web Workers for Fun and Profit

Talkat React Nexus 2025 · 2025-07-03..07-05· [web-platform, web-performance]
slides:none on file

A simple React demo moves a CPU-bound loop of 500 million iterations out of the main thread into a worker file using new Worker('worker.js'), communicates with postMessage/onmessage, and terminates the worker on unmount. The result: the counter stays responsive while the heavy computation completes and the answer is posted back, eliminating UI jank. Practical uses shown are large CSV/image/video processing, local model inference and in-browser compression (Squoosh); caveats include no DOM access and limited browser APIs.

AI-written summary · about

  1. 0:00Introduction and thanks
  2. 1:04Why JavaScript needs Web Workers
  3. 3:53Event loop and UI freezing
  4. 5:37Demo of UI freezing issue
  5. 7:25Fixing with Web Workers
  6. 9:50Final demo and performance
  7. 10:34When to use Web Workers
  8. 11:56Limitations of Web Workers
  9. 12:17Closing and resources
~/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.