Skip to content

perf: cache Evm/Handlers in Executor #8380

Open
@DaniPopes

Description

@DaniPopes

Component

Other (please describe)

Describe the feature you would like

Every time we make a call using Executor we create a new Evm. This creates the context, handlers, and instruction table, which then also have to be cleaned up after the call is done.

This is relatively inexpensive in a normal test/fuzz test which consumes hundreds of thousands of gas. However, for very short calls which consume very little gas, like in invariants, the time spent in Evm initialization and destruction is often most of the time spent in that entire call (>50%).

We can avoid this by caching the evm / instruction table / handlers. There are currently a few complications, including missing Clone, Send and Sync for some of these types.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-evmArea: EVMA-internalsArea: internalsT-perfType: performanceT-post-V1Area: to tackle after V1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions