Dani Coll

Multithreading in Javascript: A guide to Web Workers

Stop letting heavy computations freeze your UI. Learn how Web Workers unlock true parallelism in JavaScript, keeping your application responsive and running at 60 FPS.

Multithreading in Javascript: A guide to Web Workers
#1about 2 minutes

Why front-end performance matters for business success

Poor application performance leads to user churn and reduced revenue, highlighting the need to understand JavaScript's single-threaded nature.

#2about 1 minute

How the JavaScript engine executes functions

The call stack is a last-in, first-out (LIFO) data structure that the JavaScript engine uses to track function execution.

#3about 5 minutes

Demystifying asynchronous execution with the event loop

Asynchronous operations like promises and timers are managed by the event loop, which prioritizes the microtask queue over the macrotask queue.

#4about 2 minutes

Moving from concurrency to true parallelism

Web Workers enable true parallelism by running scripts on a background thread, communicating with the main thread via the postMessage API.

#5about 6 minutes

Preventing UI freezes with a Web Worker demo

A live demo shows how running a CPU-intensive chess move calculation in a Web Worker keeps the main thread responsive and the UI smooth.

#6about 3 minutes

Understanding Web Worker limitations and solutions

Web Workers cannot access the DOM and incur overhead from data serialization, but the OffscreenCanvas API allows direct canvas manipulation from a worker.

#7about 2 minutes

Leveraging libraries and frameworks for Web Workers

Libraries like Partytown can run third-party scripts in a worker, while frameworks like Neo.js are built entirely around the Web Worker paradigm.

#8about 1 minute

Final advice on using Web Workers effectively

Web Workers are a powerful tool for specific performance bottlenecks but should be considered only after optimizing the main thread code first.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

From learning to earning

Jobs that call for the skills explored in this talk.

Javascript Developer

Crowmie
Municipality of Valencia, Spain

API
REST
Scrum
JavaScript
TypeScript
+1