Skip to content

Optimize code analysis allocation #1215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chfast
Copy link
Member

@chfast chfast commented May 7, 2025

Construct analyzed code with single allocation. This replaces two allocations: one for the code copy and one for the jumpdest bitset with a single one of the following layout:

  • code copy
  • code padding (33 bytes)
  • alignment padding (0–7 bytes)
  • jumpdest bitset with 8-byte words (ceil(code.size() / 64) bits)

Copy link

codecov bot commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.53%. Comparing base (42caf43) to head (9240870).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1215   +/-   ##
=======================================
  Coverage   94.52%   94.53%           
=======================================
  Files         175      175           
  Lines       19638    19655   +17     
=======================================
+ Hits        18563    18580   +17     
  Misses       1075     1075           
Flag Coverage Δ
eest_gmp 15.36% <100.00%> (+0.05%) ⬆️
eof_execution_spec_tests 19.75% <100.00%> (+0.06%) ⬆️
ethereum_tests 21.06% <100.00%> (+0.06%) ⬆️
ethereum_tests_silkpre 18.38% <100.00%> (+0.05%) ⬆️
execution_spec_tests 18.38% <100.00%> (+0.07%) ⬆️
unittests 92.12% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/evmone/baseline.hpp 100.00% <100.00%> (ø)
lib/evmone/baseline_analysis.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


const auto padded_code_size = code.size() + PADDING;
const auto aligned_code_size =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make a struct of code + bitset_words and allocate that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah it's dynamic size, duh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, both arrays are dynamic size :(

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