EVM benchmarks (2019-05-23)
- Methodology details
These benchmarks were prepared by the Ewasm team. This section on EVM is an excerpt from a forthcoming benchmarking report (which is not published yet but will be soon(TM)), made available for the purpose of discussion around EIP-2045: Particle gas costs.
The results below show evmone setting new speed records, demonstrating the performance attainable by executing EVM bytecode in an optimized interpreter.
Sha1 with shift opcodes uses SHL and SHR opcodes (adopted in Constantinople).
Blake2b with shift opcodes uses SHL and SHR opcodes (adopted in Constantinople).
The bn128mul implementation for EVM is Weierstrudel, written in Huff, from AZTEC Protocol.
parity-precompile is the native Go and Rust code used for the ECMUL precompile in geth and parity (adopted in Byzantium).
Cita-evm is slower than parity-evm because the latest parity release uses a num-bigint library with an optimization for 256-bit division (which is used by the
MULMOD opcode), but cita-evm has not updated to use that library.
which EVM implementations are benchmarked and how?
Four EVM implementations are benchmarked:
- geth - around v1.8.25 from 2019-04-12 (this branch using this benchmarking code).
- parity - around beta 2.5.1 from 2019-05-14 (this branch using this benchmarking code).
- cita-vm - master around 2019-05-20 (this benchmarking code).
- evmone - master around 2019-04-10 (this benchmarking code).
Benchmarking also involved some dockerfiles and python scripts, which will be better documented soon.
Where can I find the EVM bytecode that was benchmarked?
What machine and OS was used to run the benchmarks?
An Azure VM and Ubuntu 18.
$ cat /proc/cpuinfo | grep "model name"| head model name : Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz model name : Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz model name : Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz model name : Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
More about evmone and cita-vm
Cita-vm is a rust implementation. From the readme:
Fast EVM implementation for CITA. Tuned for high performance, up to 5x faster than parity.
See other benchmarks in the cita-vm readme.
Evmone is a C++ implementation focused on speed.
From the readme:
The C++ implementation of the Ethereum Virtual Machine (EVM) focused on speed. Compatible with EVMC.
Characteristic of evmone
- The "indirect" subroutine threading is the dispatch method - a table with pointers to subroutines is prepared during the analysis of the bytecode.
- The gas cost and stack requirements of block of instructions is precomputed and applied once per block during execution.
- The intx library is used to provide 256-bit integer precision.
- The ethash library is used to provide Keccak hash function implementation needed for the special SHA3 instruction.