I’ve benchmarked evmone with GMP as the modexp precompile implementation. All numbers are for x86-64-v3 CPU with 4.0GHz frequency.
The inputs having the lowest gas rate are from the edge of the minimal cost of 500 gas.
| mod len (bytes) | exp len (bytes) | gas rate (Mgas/s) |
|---|---|---|
| 8 | 110 | 65.37 |
| 16 | 40 | 109.51 |
| 24 | 22 | 147.00 |
| 32 | 12 | 165.08 |
The below chart gives the overview of the bigger picture with the series of fixed mod lens:
- 32 bytes (lowers)
- 64 bytes
- 1024 bytes (highest)
In this context the formula works good for in long ranges (the curves flatten). The cheapest usage range (within 32 bytes of all arguments) is also the most common one.
We plan to introduce a in-house implementation of the modexp precompile to evmone. It may help with the performance in the low ranges but nothing is promised.
