Let It Unthread: The Good, The Bad and The Ugly within WebAssembly Portable Multithreading
With a well-defined low-level virtual instruction set, low memory footprint and fast start-up times, WebAssembly has been strongly positioned as a lightweight alternative to containers. For a long time, one missing piece from WebAssembly standaloneruntimes has been the incapacity to run shared-memory parallel code and benefit from multicore execution. With the recent WASI threads proposal, the tantalizing promise of cross-platform high-performance execution is more real than ever. In this article, we explore to what extent this promise is fulfilled by investigating the translation of POSIX threads applications to WebAssembly, and how their execution compares to native code. Using standardized benchmarks and a deep analysis of a popular standalone runtime, we reveal interesting findings on the lack of performance in multi-threaded code cross-compiled to WebAssembly. We elaborate on the difficulty of correcting these inefficiencies, and even provide a mitigation to excessive thread locking caused by the default WASI libc memory allocator. Overall, we see WASI threads as a good starting point for the efficient execution of multithreaded code.
Authors
- Marc Sánchez‐Artigas (ORCID: https://orcid.org/0000-0002-9700-7318)
- Julen Bohoyo-Bengoetxea
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-12-23
- DOI
- https://doi.org/10.5281/zenodo.18037244
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00