Characterizing WebAssembly Performance in the Era of Serverless Computing
WebAssembly provides a secure way to build portable applications that can run on different environments without the need for platform-specific code. This has led to the creation of the WebAssembly System Interface (WASI), a low-level system interface that offers a standard system interface for WebAssembly modules. WASI enables these modules to interact with the underlying operating system, accessing system resources such as the file system, network, and environment variables. With WASI, developers can build portable and efficient applications that can run on multiple operating systems and environments. However, to determine if WASI is suitable for a specific use case, it is important to compare its performance to that of native code. To this end, we conducted micro-benchmarks that were compute, memory, and file-system intensive to evaluate how WASI compares to native code. For each benchmark, we evaluated performance with compiler optimizations turned on and off. We found that WASI results were exponentially worse than native code for low-intensity workloads. For workloads with medium or high intensity, the gap between the performance of WASI and native code was small, and for some metrics, WASI outperformed native code.