Skip to content

refactor: wrap shared memory buffer#3628

Open
DaniPopes wants to merge 2 commits intobluealloy:mainfrom
DaniPopes:zeroed-shared-memory-buffer
Open

refactor: wrap shared memory buffer#3628
DaniPopes wants to merge 2 commits intobluealloy:mainfrom
DaniPopes:zeroed-shared-memory-buffer

Conversation

@DaniPopes
Copy link
Copy Markdown
Collaborator

@DaniPopes DaniPopes commented Apr 28, 2026

This wraps the shared memory Rc<RefCell<Vec>> in a SharedMemoryBuffer type so the Rc/RefCell details are kept in one place. LocalContext and SharedMemory now use the wrapper directly, while callers borrow initialized memory through slice-returning APIs.

This is only a cleanup around ownership and borrowing; it keeps normal Vec resizing behavior and avoids changing the buffer allocation/zeroing strategy.

Verified with cargo fmt --all, cargo test -p revm-context-interface --lib, cargo test -p revm-interpreter call_inputs --lib, and cargo check -p revm-context-interface -p revm-context -p revm-interpreter --all-features.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 28, 2026

Merging this PR will improve performance by 3.63%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 175 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation MSTORE_50 20.1 µs 19.4 µs +3.63%

Comparing DaniPopes:zeroed-shared-memory-buffer (853a17b) with main (1085ccf)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@DaniPopes DaniPopes changed the title fix: zero shared memory spare capacity refactor: wrap shared memory buffer Apr 28, 2026
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.

1 participant