Let It Unthread: The Good, The Bad and The Ugly within WebAssembly Portable Multithreading
Authors/Creators
Description
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 standalone
runtimes 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.
Files
CCGRID25.pdf
Files
(795.5 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:c50b04b7eac6fface965a2b6947a6c79
|
795.5 kB | Preview Download |
Additional details
Funding
Software
- Repository URL
- https://zenodo.org/records/14899517