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

Related Articles

View all articles
DC
Daniel Cranney
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!
Inside last week’s Dev Digest 195 . 👎 No more external likes 🤗 Needy programs 📉 The worst selling Microsoft product 🟨 JavaScript engines zoo 🍞 No more toasts! 🤖 Messing with bots 👔 Beware of fake job interviews 🗞️ Join over 150,000 developers alread...
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos

From learning to earning

Jobs that call for the skills explored in this talk.

Creative Javascript

Creative Javascript

Thegiglab
Amsterdam, Netherlands

Intermediate
API
CSS
HTML
jQuery
Bootstrap
+1