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

Published: 16 August 2021
on channel: SimonDev
67,174
3.5k

Can you make JavaScript run even faster? Or is it limited as a single thread language?

Patreon:   / simondevyt  

Follow me on:
Twitter:   / iced_coffee_dev  
Instagram:   / beer_and_code  
Github: https://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:
https://developer.mozilla.org/en-US/d...
https://surma.dev/
https://surma.dev/things/is-postmessa...
https://v8.dev/docs/embed
https://developer.mozilla.org/en-US/d...
https://developer.mozilla.org/en-US/d...
https://developer.mozilla.org/en-US/d...
https://developers.google.com/web/upd...
https://en.wikipedia.org/wiki/JavaScript

And yes, Node also has threads:
https://nodejs.org/api/worker_threads...


Watch video Can JavaScript Go Faster? Threading in JavaScript (Data Structures & Optimization) online without registration, duration hours minute second in high quality. This video was added by user SimonDev 16 August 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 67,174 once and liked it 3.5 thousand people.