Wasmachine: Bring the Edge up to Speed with A WebAssembly OS

Elliott Wen, Gerald Weber · 2020

WebAssembly is gaining wide adoption in browser-centric applications thanks to its high portability and security. More recently, researchers start exploring the potential of WebAssembly in non-web environments, particularly in IoT and Edge computing. A key challenge of WebAssembly is performance gap with native code: applications compiled to WebAssembly run slower by an average of 45% as reported by previous benchmark. The main causes of the slowdown are two-folded. Firstly, conventional WebAssembly runtimes translate WebAssembly instructions to native machine code using just-in-time compilers, which do not apply complex code optimization. Secondly, system calls from WebAssembly applications have to be proxy-ed by runtimes in order to reach operating systems, which incurs a significant performance overhead. To address these issues, we present Wasmachine, an OS aiming to efficiently and securely execute WebAssembly applications in IoT and edge devices with constrained resources. Wasmachine achieves efficient execution by compiling WebAssembly ahead of time to native binary and executing it in kernel mode for zero-cost system calls. Even when executing in kernel space, Wasmachine stays secure by exploiting various language features of WebAssembly to deliver software-based fault isolation. We implement the Was-machine prototype in the memory-safe programming language Rust and conduct a performance evaluation. Our results show that WebAssembly applications running in Wasmachine are up to 21% faster than their native counterparts in Linux.

Read the paper · More papers on PaperTik