Go-ethereum Benchmark Update for EVM384 and Friends

A tentative specification for extension of modular arithmetic support to bitwidths beyond 256-bits in the EVM is outlined in https://notes.ethereum.org/@poemm/eip_draft_evm_modular_arithmetic_extensions .

A Go-ethereum implementation has been created for the purposes of measuring the performance of a portable (non-assembly) implementation of the arithmetic as well as the overhead of the client "boilerplate" code.

Benchmarks were measured on an i5-6600K processor (3.5 GHz). 10 ns / gas was chosen as a (conservative) target gas rate. Benchmarks are presented alongside pricing models proposed in the EIP draft.

For more context, client benchmarks of a Go-assembly implementation of the arithmetic for 384-bit values are also shown.

Note that benchmarks aim to show the worst-case performance (final subtraction performed for MULMONT, slowest paths for ADDMONT/SUBMONT). Performance of MULMONT at larger bitwidths is omitted because 1) the implementation is currently unnacceptably slow after 9 limbs (576 bits) and 2) the performance can vary considerably based on values that are chosen (widths above 576 bits implement generic montgomery multiplication using the Go standard library's big.Int which does allocations under the hood)

ADDMONT:

SUBMONT:

MULMONT:

EVM BLS12381 Pairing Benchmarks

Benchmarks for the Miller Loop and Final Exponentation are from test cases provided by EVMcurves.


For the raw benchmark data, traces and scripts to produce the graphs, see https://github.com/jwasinger/plots/tree/master/mont-arith-bench

Select a repo