SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
MULTICORE JS 🚀
PAST, PRESENT AND FUTURE
UJJWAL SHARMA (@RYZOKUKEN)
JSCONF INDIA 2021 🇮🇳
@ryzokuken
ABOUT ME 👦
@ryzokuken
@ryzokuken
Ujjwal "Ryzokuken" Sharma
Compilers Hacker at Igalia
TC39 Delegate
ECMA-402 Editor
Node.js Core Collaborator
V8 Contributor
International Speaker
@ryzokuken
@ryzokuken
ABOUT IGALIA 💼
Software Consultancy
HQ in Galicia, Spain 🇪🇸
Free Software
TC39, W3C
Web Browsers 🌐
Compilers
Web Standards 📚
@ryzokuken
IGALIA 💖BLOOMBERG 💖GOOGLE
@ryzokuken
WHY MULTICORE JS? 👨‍💻
JavaScript was designed in 1995 (26 years ago)
CPU hardware is scaling with multi-core, big/little rather than frequency
The client side is moving to the Web
JS and WASM are taking over servers too!
e.g., Fastly's and CloudFlare's models
Important to expose hardware capabilities to software
@ryzokuken
WHY DO I CARE? 😳
Your users use a mobile phone
You run JS or WASM on a server
You build computationally heavy web applications
You want to utilize full hardware capabilties.
@ryzokuken
OLD NEWS ⏳
High-level async constructs (allows work in the background)
Workers (and SharedWorkers, ServiceWorker, AudioWorklet, etc)
postMessage
MessageChannel
async/await
WebAssembly MVP
@ryzokuken
FAILED ATTEMPTS 😿
ParallelJS
SIMD.js
@ryzokuken
RECENT WINS 🏆
Atomics and SAB
WeakRef
WASM Threading
WASM SIMD
@ryzokuken
ARE STANDARDS A GOOD PLACE TO GET STUFF DONE? 😅
Project Fugu shows that multi-implementer standards aren't the only way to
ship
However, the JS and Wasm world does operate on a lockstep model
Many big efforts have successfully been developed in standards bodies and
then shipped broadly
@ryzokuken
ARE STANDARDS A GOOD PLACE TO GET STUFF DONE? 😅
Important to have a coherent whole for JS and Wasm
JS/Wasm engine teams have historically been more conservative about
implementing non-standard things than higher levels of Chromium
When this path was not taken, it is seen as a mistake, e.g., PJS and
strong mode
@ryzokuken
CONCURRENT JS 🐎
A VISION FOR THE FUTURE OF JAVASCRIPT
@ryzokuken
A TALE OF TWO CONCURRENCY MODELS ♻
@ryzokuken
WEB-LIKE 🕸
Run-to-completion (Workers)
Message-passing (postMessage)
Async APIs (Promises)
No data races, data isolation
@ryzokuken
THREAD-LIKE 🧵
Sync APIs, manual synchronization (Atomics)
Data races, shared memory (SABs)
@ryzokuken
WEB-LIKE 🕸
@ryzokuken
THREAD-LIKE 🧵
@ryzokuken
@ryzokuken
REALITY
@ryzokuken
@ryzokuken
WEB-LIKE 🕸
GOODS
BADS
Ease of reasoning + using
Causal
Data race free by construction
Isolation
Asynchronous = smoother
Less focused on manual synchronization mechanics (locks, queues, etc)
Leaving performance on the table
@ryzokuken
THREAD-LIKE 🧵
GOODS
BADS
WebAssembly interop
WasmGC interop
Good performance
Hard to reason & use
Manual synchronization
Data races
Acausal astonishments
"Must be this tall"
Exposes more timing channels
@ryzokuken
LET'S IMPROVE BOTH MODELS SIMULTANEOUSLY! 😇
@ryzokuken
ROADMAP 🛣🗺
@ryzokuken
PHASE 1
WEB-LIKE
THREAD-LIKE
Language support for asynchronous communication
Ability to spawn units of computation
Shared memory
Basic synchronization primitive
Ability to spawn threads
@ryzokuken
PHASE 1
Actually, we're done here! ✅
Promises
async/await
Workers
SharedArrayBuffer
Atomics
@ryzokuken
PHASE 2
WEB-LIKE
THREAD-LIKE
Ergonomic and performant data transfer
Ergonomic and performant code transfer
Higher level objects that allow concurrent access
Higher level synchronization mechanisms
@ryzokuken
PHASE 2 🕸
Designed to address biggest observed pain points
Transferring data is expensive:
Transferrables very limited
Weird reparenting of [[Prototype]] even when transferred
Often copied
Transferring data is unergonomic:
Often requires serialization/deserialization
Identity discontinuity
Transferring code is basically not possible, we transfer strings
@ryzokuken
PROPOSAL: MODULE BLOCKS
Aims to solve: Ergonomic sharing of code
Spearheaded by Surma
let moduleBlock = module {
export let y = 1;
};
let moduleExports = await import(moduleBlock);
assert(moduleExports.y === 1);
assert(await import(moduleBlock) === moduleExports);
@ryzokuken
UPCOMING PROPOSAL: SHARED DISJOINT HEAPS
Aims to solve: Ergonomic and performant sharing of data and code
Let developers separate their heap
Agent-local heaps can point into shareable heaps
Shareable heaps cannot point into agent-local heaps
Unit of sharing is transferable heap
@ryzokuken
PHASE 2 🧵
Also designed to address biggest observed pain points
Nobody knows how to use SABs and Atomics well
Impedance mismatch too high
@ryzokuken
PROPOSAL: STRUCTS
Aims to solve: Higher-level objects that allow concurrent access
Spearheaded by Shu-yu Guo
struct class Box {
constructor(x) { this.x = x; }
x;
}
let box = new Box();
box.x = 42; // x is declared
assertThrows(() => { box.y = 8.8; }); // structs are
sealed
assertThrows(() => { box.__proto__ = {} }); // structs are
sealed
@ryzokuken
FUTURE PHASE
WEB-LIKE
THREAD-LIKE
Lighter-weight actors?
Integration with scheduling APIs
Concurrent std lib?
Tooling?
Integration with WasmGC
Concurrent std lib?
@ryzokuken
SPECIAL THANKS 🙇
Daniel Ehrenberg
Shu-yu Guo
The organizers and programme committee
@ryzokuken
THANK YOU! 🙏
@ryzokuken

Más contenido relacionado

Similar a Multicore Javascript Past, Present and Future.pdf

Containerizing couchbase with microservice architecture on mesosphere.pptx
Containerizing couchbase with microservice architecture on mesosphere.pptxContainerizing couchbase with microservice architecture on mesosphere.pptx
Containerizing couchbase with microservice architecture on mesosphere.pptxRavi Yadav
 
Overview of QP Frameworks and QM Modeling Tools (Notes)
Overview of QP Frameworks and QM Modeling Tools (Notes)Overview of QP Frameworks and QM Modeling Tools (Notes)
Overview of QP Frameworks and QM Modeling Tools (Notes)Quantum Leaps, LLC
 
ParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel ProgrammingParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel Programmingkhstandrews
 
Oracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to MicroservicesOracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to MicroservicesAlberto Salazar
 
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia 2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia Alberto Salazar
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack DiscussionZaiyang Li
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessMarkus Eisele
 
Daniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDaniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDevelcz
 
BISSA: Empowering Web gadget Communication with Tuple Spaces
BISSA: Empowering Web gadget Communication with Tuple SpacesBISSA: Empowering Web gadget Communication with Tuple Spaces
BISSA: Empowering Web gadget Communication with Tuple SpacesSrinath Perera
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MMarkus Eisele
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureFrank Greco
 
OrientDB the database for the web 1.1
OrientDB the database for the web 1.1OrientDB the database for the web 1.1
OrientDB the database for the web 1.1Luca Garulli
 
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...Alberto Salazar
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSimon Haslam
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Marc Dutoo
 
#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to Microservices#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to MicroservicesAlberto Salazar
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusBoldRadius Solutions
 

Similar a Multicore Javascript Past, Present and Future.pdf (20)

Containerizing couchbase with microservice architecture on mesosphere.pptx
Containerizing couchbase with microservice architecture on mesosphere.pptxContainerizing couchbase with microservice architecture on mesosphere.pptx
Containerizing couchbase with microservice architecture on mesosphere.pptx
 
Overview of QP Frameworks and QM Modeling Tools (Notes)
Overview of QP Frameworks and QM Modeling Tools (Notes)Overview of QP Frameworks and QM Modeling Tools (Notes)
Overview of QP Frameworks and QM Modeling Tools (Notes)
 
ParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel ProgrammingParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel Programming
 
Oracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to MicroservicesOracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to Microservices
 
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia 2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
Daniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDaniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého Schizma
 
Sexy React Stack
Sexy React StackSexy React Stack
Sexy React Stack
 
BISSA: Empowering Web gadget Communication with Tuple Spaces
BISSA: Empowering Web gadget Communication with Tuple SpacesBISSA: Empowering Web gadget Communication with Tuple Spaces
BISSA: Empowering Web gadget Communication with Tuple Spaces
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the Future
 
OrientDB the database for the web 1.1
OrientDB the database for the web 1.1OrientDB the database for the web 1.1
OrientDB the database for the web 1.1
 
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the Cloud
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
 
#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to Microservices#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to Microservices
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadius
 
GraphQL for Native Apps
GraphQL for Native AppsGraphQL for Native Apps
GraphQL for Native Apps
 

Más de Igalia

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEIgalia
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesIgalia
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceIgalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfIgalia
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JITIgalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerIgalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in MesaIgalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsIgalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesIgalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSIgalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webIgalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersIgalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on RaspberryIgalia
 

Más de Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Multicore Javascript Past, Present and Future.pdf

  • 1. MULTICORE JS 🚀 PAST, PRESENT AND FUTURE UJJWAL SHARMA (@RYZOKUKEN) JSCONF INDIA 2021 🇮🇳 @ryzokuken
  • 4. Ujjwal "Ryzokuken" Sharma Compilers Hacker at Igalia TC39 Delegate ECMA-402 Editor Node.js Core Collaborator V8 Contributor International Speaker @ryzokuken
  • 6. ABOUT IGALIA 💼 Software Consultancy HQ in Galicia, Spain 🇪🇸 Free Software TC39, W3C Web Browsers 🌐 Compilers Web Standards 📚 @ryzokuken
  • 8. WHY MULTICORE JS? 👨‍💻 JavaScript was designed in 1995 (26 years ago) CPU hardware is scaling with multi-core, big/little rather than frequency The client side is moving to the Web JS and WASM are taking over servers too! e.g., Fastly's and CloudFlare's models Important to expose hardware capabilities to software @ryzokuken
  • 9. WHY DO I CARE? 😳 Your users use a mobile phone You run JS or WASM on a server You build computationally heavy web applications You want to utilize full hardware capabilties. @ryzokuken
  • 10. OLD NEWS ⏳ High-level async constructs (allows work in the background) Workers (and SharedWorkers, ServiceWorker, AudioWorklet, etc) postMessage MessageChannel async/await WebAssembly MVP @ryzokuken
  • 12. RECENT WINS 🏆 Atomics and SAB WeakRef WASM Threading WASM SIMD @ryzokuken
  • 13. ARE STANDARDS A GOOD PLACE TO GET STUFF DONE? 😅 Project Fugu shows that multi-implementer standards aren't the only way to ship However, the JS and Wasm world does operate on a lockstep model Many big efforts have successfully been developed in standards bodies and then shipped broadly @ryzokuken
  • 14. ARE STANDARDS A GOOD PLACE TO GET STUFF DONE? 😅 Important to have a coherent whole for JS and Wasm JS/Wasm engine teams have historically been more conservative about implementing non-standard things than higher levels of Chromium When this path was not taken, it is seen as a mistake, e.g., PJS and strong mode @ryzokuken
  • 15. CONCURRENT JS 🐎 A VISION FOR THE FUTURE OF JAVASCRIPT @ryzokuken
  • 16. A TALE OF TWO CONCURRENCY MODELS ♻ @ryzokuken
  • 17. WEB-LIKE 🕸 Run-to-completion (Workers) Message-passing (postMessage) Async APIs (Promises) No data races, data isolation @ryzokuken
  • 18. THREAD-LIKE 🧵 Sync APIs, manual synchronization (Atomics) Data races, shared memory (SABs) @ryzokuken
  • 24. WEB-LIKE 🕸 GOODS BADS Ease of reasoning + using Causal Data race free by construction Isolation Asynchronous = smoother Less focused on manual synchronization mechanics (locks, queues, etc) Leaving performance on the table @ryzokuken
  • 25. THREAD-LIKE 🧵 GOODS BADS WebAssembly interop WasmGC interop Good performance Hard to reason & use Manual synchronization Data races Acausal astonishments "Must be this tall" Exposes more timing channels @ryzokuken
  • 26. LET'S IMPROVE BOTH MODELS SIMULTANEOUSLY! 😇 @ryzokuken
  • 28. PHASE 1 WEB-LIKE THREAD-LIKE Language support for asynchronous communication Ability to spawn units of computation Shared memory Basic synchronization primitive Ability to spawn threads @ryzokuken
  • 29. PHASE 1 Actually, we're done here! ✅ Promises async/await Workers SharedArrayBuffer Atomics @ryzokuken
  • 30. PHASE 2 WEB-LIKE THREAD-LIKE Ergonomic and performant data transfer Ergonomic and performant code transfer Higher level objects that allow concurrent access Higher level synchronization mechanisms @ryzokuken
  • 31. PHASE 2 🕸 Designed to address biggest observed pain points Transferring data is expensive: Transferrables very limited Weird reparenting of [[Prototype]] even when transferred Often copied Transferring data is unergonomic: Often requires serialization/deserialization Identity discontinuity Transferring code is basically not possible, we transfer strings @ryzokuken
  • 32. PROPOSAL: MODULE BLOCKS Aims to solve: Ergonomic sharing of code Spearheaded by Surma let moduleBlock = module { export let y = 1; }; let moduleExports = await import(moduleBlock); assert(moduleExports.y === 1); assert(await import(moduleBlock) === moduleExports); @ryzokuken
  • 33. UPCOMING PROPOSAL: SHARED DISJOINT HEAPS Aims to solve: Ergonomic and performant sharing of data and code Let developers separate their heap Agent-local heaps can point into shareable heaps Shareable heaps cannot point into agent-local heaps Unit of sharing is transferable heap @ryzokuken
  • 34. PHASE 2 🧵 Also designed to address biggest observed pain points Nobody knows how to use SABs and Atomics well Impedance mismatch too high @ryzokuken
  • 35. PROPOSAL: STRUCTS Aims to solve: Higher-level objects that allow concurrent access Spearheaded by Shu-yu Guo struct class Box { constructor(x) { this.x = x; } x; } let box = new Box(); box.x = 42; // x is declared assertThrows(() => { box.y = 8.8; }); // structs are sealed assertThrows(() => { box.__proto__ = {} }); // structs are sealed @ryzokuken
  • 36. FUTURE PHASE WEB-LIKE THREAD-LIKE Lighter-weight actors? Integration with scheduling APIs Concurrent std lib? Tooling? Integration with WasmGC Concurrent std lib? @ryzokuken
  • 37. SPECIAL THANKS 🙇 Daniel Ehrenberg Shu-yu Guo The organizers and programme committee @ryzokuken