Skip to content

perf: optimize jump table initialization and reuse - #3

Open
lily309 wants to merge 1 commit into
masterfrom
opt/jumptable-optimization
Open

perf: optimize jump table initialization and reuse#3
lily309 wants to merge 1 commit into
masterfrom
opt/jumptable-optimization

Conversation

@lily309

@lily309 lily309 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

  • Removes unused historical version entries and eagerly initialized table mappings while retaining the existing operation-set builders.
  • Centralizes the newest operation set selection through LATEST_VERSION and newLatestOperationSet().
  • Creates dedicated instances of the latest jump table for transactions and constant calls.
  • Reuses both tables across executions.
  • Applies configuration-dependent adjustments once per top-level execution.
  • Reuses the prepared table for nested contract calls and contract creation.

Why is this needed?

The previous implementation initialized jump tables for multiple historical versions even though only the latest version was selected for execution.

Transactions and constant calls also shared the same table, which allowed adjustments made for constant calls to affect transaction execution. In addition, configuration-dependent adjustments could be applied repeatedly during nested calls and contract creation.

This change centralizes the selection of the latest operation set and separates transaction and constant-call tables. It reduces startup initialization and repeated adjustment overhead while keeping the two execution paths isolated.

Tests

  • Added coverage for transaction and constant-call table isolation.
  • Added coverage for table reuse across executions.
  • Verified that constant-call adjustments do not affect the transaction table.
  • Verified transaction, constant-call, nested-call, and contract-creation execution paths.
  • Verified existing instruction and configuration-dependent behavior.

@yanghang8612
yanghang8612 force-pushed the opt/jumptable-optimization branch 4 times, most recently from 71a6833 to 550bc56 Compare September 1, 2026 10:05
@yanghang8612
yanghang8612 force-pushed the opt/jumptable-optimization branch from 550bc56 to 2b76924 Compare September 1, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants