Abstract / Description of output
WebAssembly is gaining more and more popularity, finding applications beyond the Web browser -- for which it was initially designed for.
However, its performance, which developers aimed at being comparable to native, requires further tuning, and has not been extensively studied to pinpoint the cause of various overheads.
This paper identifies that WebAssembly's unique safety mechanisms, the major one being bounds-checked memory accesses, may introduce up to a 650% overhead.
Therefore, we evaluate four popular WebAssembly runtimes against native compiled code.
These runtimes have been enriched with modern bounds checking mechanisms and run on three different ISAs, including x86-64, Armv8 and RISC-V RV64GC.
We show that performance-oriented runtimes are able to achieve performance within 20% of native on x86_64 platforms, and 35% for Armv8. On RISC-V the V8 runtime can achieve a 17% overhead over native code for simple numeric kernels.
For simple numerical kernels, we have shown that there is no significant difference in the WebAssembly performance compared to native code across different ISAs.
We also show that in the case of multithreaded scaling of the tested runtimes, which might for example be used to quickly scale up serverless instances for a single function without the overhead of spawning new processes, the default approach taken by WAVM, Wasmtime, and V8 of using the mprotect syscall to resize memory can cause excessive locking in the Linux kernel and so present an alternative userfaultfd-based solution to mitigate this issue.
We share our results, and the tools and scripts under an open source license for other researchers to replicate our results, and monitor the progress that WebAssembly runtimes make as this technology evolves.
However, its performance, which developers aimed at being comparable to native, requires further tuning, and has not been extensively studied to pinpoint the cause of various overheads.
This paper identifies that WebAssembly's unique safety mechanisms, the major one being bounds-checked memory accesses, may introduce up to a 650% overhead.
Therefore, we evaluate four popular WebAssembly runtimes against native compiled code.
These runtimes have been enriched with modern bounds checking mechanisms and run on three different ISAs, including x86-64, Armv8 and RISC-V RV64GC.
We show that performance-oriented runtimes are able to achieve performance within 20% of native on x86_64 platforms, and 35% for Armv8. On RISC-V the V8 runtime can achieve a 17% overhead over native code for simple numeric kernels.
For simple numerical kernels, we have shown that there is no significant difference in the WebAssembly performance compared to native code across different ISAs.
We also show that in the case of multithreaded scaling of the tested runtimes, which might for example be used to quickly scale up serverless instances for a single function without the overhead of spawning new processes, the default approach taken by WAVM, Wasmtime, and V8 of using the mprotect syscall to resize memory can cause excessive locking in the Linux kernel and so present an alternative userfaultfd-based solution to mitigate this issue.
We share our results, and the tools and scripts under an open source license for other researchers to replicate our results, and monitor the progress that WebAssembly runtimes make as this technology evolves.
Original language | English |
---|---|
Title of host publication | Proceedings of the 2022 IEEE International Symposium on Workload Characterization (IISWC 2022) |
Publisher | Institute of Electrical and Electronics Engineers |
Pages | 256-268 |
Number of pages | 11 |
ISBN (Electronic) | 978-1-6654-8798-6 |
ISBN (Print) | 978-1-6654-8799-3 |
DOIs | |
Publication status | Published - 13 Dec 2022 |
Event | 2022 IEEE International Symposium on Workload Characterization - Austin, United States Duration: 6 Nov 2022 → 8 Nov 2022 http://www.iiswc.org/iiswc2022/ |
Symposium
Symposium | 2022 IEEE International Symposium on Workload Characterization |
---|---|
Abbreviated title | IISWC 2022 |
Country/Territory | United States |
City | Austin |
Period | 6/11/22 → 8/11/22 |
Internet address |