ParaWeb: Parallel Programming Patterns for Web Development
Suejb Memeti
Abstract
Modern web applications increasingly require computationally intensive processing, yet JavaScript, the dominant language of the web, has traditionally been limited to a single-threaded execution model. Node.js Worker Threads and browser Web Workers provide low-level mechanisms for parallel execution, but developers lack high-level abstractions that capture recurring parallel structures as reusable patterns. In this paper, we present ParaWeb, a TypeScript library that implements ten parallel programming patterns for server-side Node.js, client-side browser environments, and WebGPU compute shaders. ParaWeb provides three implementation variants for each pattern: a message-passing (MP) variant based on structured cloning via postMessage, a shared-buffer (Shared) variant that uses SharedArrayBuffer with typed array views, and a GPU variant that uses WebGPU compute shaders for hardware-accelerated execution. We describe the architecture, design decisions, and pattern-specific implementation strategies, and we evaluate the performance of all thirty implementations across three data sizes. Experimental evaluation results show that the CPU-based variants achieve speedups of up to 11.6x with 16 threads for compute-bound patterns, while the GPU variants reach speedups of up to 260x for compute-bound patterns with high arithmetic intensity such as Farm, Scatter, Reduce, and Map. A case study on five image-convolution filters further shows that GPU acceleration reaches up to 414x speedup over single-threaded CPU on non-separable kernels, with consistent scaling across 1024x1024, 2048x2048, and 4K images.
Create a lesson
Related papers
Replication-Aware Placement of Functions and Data in the Edge-Cloud Continuum
Dario d'Abate, Matteo Cenzato, Matteo Briscini et al.
Ermes: a Stateful Serverless Platform for the Edge-to-Cloud Continuum
Matteo Cenzato, Dario d'Abate, Arianna Dragoni et al.
Fluid Notarization: Verifiable Evolution of Concurrently Edited Structured Documents
Amos Brocco, Giuliano Gremlich, Roberto Guidi
Ask the Tool, Don't Guess: Agent Tool Calls Hold Their Progress, and the Serving System Should Read It
Yipeng Liu, Yingqiang Zhang, Feifei Li et al.
A Distributed Computing Framework for Satellite Swarms
Ezra Fielding, Clement Demazure, Guthemberg Silvestre et al.
Vigil: Accountable Liveness against Selective Silence
Jiawei Cheng, Huiping Sun, Rui Zhou et al.