An Empirical Study on the Performance of EVMs and Wasm VMs for Smart Contract Execution
摘要
Blockchain and smart contract technology allow for the implementation of various decentralized applications. Smart contracts are typically developed in a high-level language, compiled into bytecode, and executed in a virtual machine (VM) on the blockchain client. Consequently, the VM’s performance significantly determines the execution speed of smart contracts, the clients’ resource overhead, and even the exploitable vulnerabilities. EVM is currently the most widely adopted VM, and several blockchains have developed customized EVMs to suit their specific requirements. However, the extent to which different EVM implementations exhibit performance differences has not been fully investigated. Moreover, the Wasm VM (WVM) has demonstrated satisfactory performance in the Web domain, and it is regarded as a promising candidate for the next generation of smart contract VMs. However, it remains unclear whether WVMs offer superior functionality and performance compared to EVMs. To fill these gaps, this paper presents an empirical investigation of EVMs and WVMs. First, we compare the performance of EVMs implemented in Go, Rust, and C++ to provide blockchain nodes with suggestions on which EVM to adopt. Subsequently, we conduct a comparative analysis of EVMs and WVMs on three blockchain clients regarding five performance metrics. The results indicate that WVMs perform inferior to EVMs on all metrics. Furthermore, the findings and insights presented in this paper offer valuable recommendations for the evolution of WVMs.