Can JavaScript Go Faster? Threading in JavaScript (Data Structures & Optimization) @simondev758
Can JavaScript Go Faster? Threading in JavaScript (Data Structures & Optimization)  @simondev758
Uploaded August 2021 | Updated September 2026, 3 weeks ago
Can you make JavaScript run even faster? Or is it limited as a single thread language?

Patreon: patreon.com/simondevyt

Follow me on:
Twitter: twitter.com/iced_coffee_dev
Instagram: instagram.com/beer_and_code
Github: github.com/simondevyoutube

In this video we talk a bit about JavaScript's mechanisms for concurrency and spreading the work out over multiple threads/cores. We'll cover the web worker API in a bit of detail, dedicated workers, and then we'll move on to creating a small testing setup. It's kind of interesting to explore the threading opportunities that JavaScripts offers through the Web Worker API, the various pitfalls and performance footguns that lurk there, and what you can do to mitigate these issues. We'll also explore using transferable objects with ArrayBuffer, and touch quickly on what SharedArrayBuffer unlocks in terms of concurrency and multiple threads reading/writing.

Links:
developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API
https://surma.dev/
https://surma.dev/things/is-postmessage-slow/
https://v8.dev/docs/embed
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage
developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast
en.wikipedia.org/wiki/JavaScript

And yes, Node also has threads:
nodejs.org/api/worker_threads.html
Can JavaScript Go Faster? Threading in JavaScript (Data Structures & Optimization)Most Optimization Advice Misses the REAL ProblemBuilding a Simple 3D Scene with Physics in JavaScript & Three.js3D World Generation #8: Floating Origins for Bigger Worlds (JavaScript/Three.js)3D World Generation: #5 (Texturing): Triplanar Mapping/Infinite Splatting/Blending/BombingThe ONE Texture Every Game NEEDS3D Mesh Generation, Gaps, and Stitching (3D World Generation #10)Spatial Hash Grids & Tales from Game Development
SimonDev |

Can JavaScript Go Faster? Threading in JavaScript (Data Structures & Optimization)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER