Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new BenchmarkDotNet suite to benchmark “raw” EVM opcode handlers (function-pointer dispatch, close to the VirtualMachine execution path) and extends benchmark output with opcode gas/throughput columns.
Changes:
- Introduce
EvmOpcodesBenchmarkplus a custom column provider to report per-opcode gas and MGas/s. - Expose additional internals needed by the benchmark (
InternalsVisibleTo, code cache clearing). - Update benchmark runner/config and solution composition to include additional assemblies/projects.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Nethermind/Nethermind.Precompiles.Benchmark/GasColumnProvider.cs |
Makes gas column extraction safer and only available when the expected Input param type is present. |
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.cs |
Grants Nethermind.Evm.Benchmark access to internal EvmInstructions for opcode table generation. |
src/Nethermind/Nethermind.Evm/CodeInfoRepository.cs |
Adds internal cache clearing APIs to support benchmark iteration isolation. |
src/Nethermind/Nethermind.Evm.Benchmark/Nethermind.Evm.Benchmark.csproj |
Enables unsafe blocks needed for function pointers in the new benchmark. |
src/Nethermind/Nethermind.Evm.Benchmark/EvmOpcodesBenchmark.cs |
New benchmark executing opcode handlers directly with per-opcode stack/environment setup. |
src/Nethermind/Nethermind.Evm.Benchmark/EvmOpcodeGasColumnProvider.cs |
New BenchmarkDotNet column provider computing per-opcode gas and derived throughput. |
src/Nethermind/Nethermind.Benchmark.Runner/Program.cs |
Adds --quick mode and switches to a BenchmarkSwitcher flow for running multiple assemblies. |
src/Nethermind/Benchmarks.slnx |
Adds additional projects to the benchmarks solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Alas it looks like a shared CI machine is very variable #10651 (comment) |
this is why you should follow the same approach in that Branch:
2. introduce multiple operations per invoke:
so innerCount needs to be high enough so each iteration is not less than 100ms, the higher the inner count the better i believe
Also, please add the columns as shown in the first picture. |


Changes
Nethermind.Benchmark.Runnerprojectdotnet run -c Release -- --filter "*EvmOpcodesBenchmark*"VirtualMachineexecution pathGenerateOpCodestable used at runtime, parametrized via[ParamsSource]over all opcodesCodeInfoRepository.Clear()to flush code cache between iterations, preventing warm-cache biasBenchmarkSwitcher, add--quickflag (ShortRun vs MediumRun), update toCoreRuntime.Core10_0GasColumnProviderto gracefully handle non-precompile benchmarks in mixed runs2:30mins to produce output for 140+ opcodes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
Documentation
Requires documentation update
Requires explanation in Release Notes