WebAssembly (Wasm) is a bytecode format originally serving as a compilation target for Web applications. It has recently been used increasingly on the server side, e.g., providing a safer, faster, and more portable alternative to Linux containers. With the popularity of server-side Wasm applications, it is essential to study performance issues (i.e., abnormal latency) in Wasm runtimes, as they may cause a significant impact on server-side applications. However, there is still a lack of attention to performance issues in server-side Wasm runtimes. In this paper, we design a novel differential testing approach WarpDiff to identify performance issues in server-side Wasm runtimes. The key insight is that in normal cases, the execution time of the same test case on different Wasm runtimes should follow an oracle ratio. We identify abnormal cases where the execution time ratio significantly deviates from the oracle ratio and subsequently locate the Wasm runtimes that cause the performance issues. We apply WarpDiff to test five popular server-side Wasm runtimes using 123 test cases from the LLVM test suite and demonstrate the top 10 abnormal cases we identified. We further conduct an in-depth analysis of these abnormal cases and summarize seven performance issues, all of which have been confirmed by the developers. We hope our work can inspire future investigation on improving Wasm runtime implementation and thus promoting the development of server-side Wasm applications.
翻译:WebAssembly(Wasm)是一种最初作为Web应用编译目标的字节码格式。近年来,它在服务端的应用日益增多,例如作为Linux容器的更安全、更快速且更具可移植性的替代方案。随着服务端Wasm应用的普及,研究Wasm运行时的性能问题(即异常延迟)至关重要,因为这些问题可能对服务端应用产生重大影响。然而,目前对服务端Wasm运行时性能问题的关注仍显不足。本文设计了一种新颖的差异测试方法WarpDiff,用于识别服务端Wasm运行时中的性能问题。其关键洞察在于:正常情况下,同一测试用例在不同Wasm运行时上的执行时间应遵循一个基准比例。我们识别出执行时间比显著偏离该基准比例的异常情况,进而定位导致性能问题的Wasm运行时。我们应用WarpDiff对来自LLVM测试集的123个测试用例进行了五个主流服务端Wasm运行时的测试,并展示了识别出的前10个异常案例。我们进一步深入分析了这些异常案例,总结了七个性能问题,所有问题均已得到开发者的确认。我们希望这项工作能够启发未来对改进Wasm运行时实现的研究,从而推动服务端Wasm应用的发展。