~/talk

Multithreading in Javascript

Talkat CityJS Athens 2025 · 2025-05-28..05-31· [javascript, web-platform]
name:Dani Coll
github:dani-coll
slides:none on file

Argues that heavy CPU work belongs off the main thread and demonstrates it by running a JS Chess Engine demo on the main thread versus a Web Worker, showing the main-thread run freezes the UI and FPS drops to zero while the worker keeps the board interactive and returns the same move. Explains Web Worker API usage, tradeoffs: serialized message copying, no DOM, and suggests OffscreenCanvas for chart rendering and a worker-first framework option, advising to optimize the main thread before adding workers.

AI-written summary · about

  1. 0:00Introduction to multithreading
  2. 1:04JavaScript single-threaded model
  3. 3:13Synchronous vs asynchronous code
  4. 5:07Event loop and task queues
  5. 6:56Limitations of multithreading
  6. 7:16Web Workers explained
  7. 10:33Live demo with chess game
  8. 14:33Web Workers limitations
  9. 17:30Offscreen canvas use case
  10. 18:53When to use web workers
  11. 19:36Key takeaways and conclusion
  12. 20:24Q&A session
~/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.