Skip to content
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

fix: remove recomputing memtrie node memory usages #12362

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

Longarithm
Copy link
Member

@Longarithm Longarithm commented Nov 1, 2024

Issue: #12361

After #12359, we can take memory usages from updated_nodes instead of recomputing them again.

The original plan was to remove reading child nodes completely, where it is not necessary. However, we still need to read hash, and hash is still a part of child' MemTrieNodeId... Moreover, it doesn't make sense to store hashes of children in the node for memory savings.

I think we just need to live with it then. At least the usecase is very clear now. If we ever want to make memtrie recording cleaner (make it a side effect of MemTrieNodePtr::view?), we need to skip recording node only if its hash is needed.

@Longarithm Longarithm requested a review from a team as a code owner November 1, 2024 18:47
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.21%. Comparing base (a86de63) to head (65e24f2).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12362      +/-   ##
==========================================
+ Coverage   71.19%   71.21%   +0.01%     
==========================================
  Files         839      839              
  Lines      169914   169895      -19     
  Branches   169914   169895      -19     
==========================================
+ Hits       120969   120984      +15     
+ Misses      43681    43650      -31     
+ Partials     5264     5261       -3     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (+<0.01%) ⬆️
db-migration 0.16% <0.00%> (+<0.01%) ⬆️
genesis-check 1.23% <0.00%> (+<0.01%) ⬆️
integration-tests 38.95% <100.00%> (+0.03%) ⬆️
linux 70.65% <100.00%> (+<0.01%) ⬆️
linux-nightly 70.79% <100.00%> (+0.01%) ⬆️
macos 50.41% <100.00%> (-0.03%) ⬇️
pytests 1.54% <0.00%> (+<0.01%) ⬆️
sanity-checks 1.35% <0.00%> (+<0.01%) ⬆️
unittests 64.13% <100.00%> (-0.01%) ⬇️
upgradability 0.21% <0.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@shreyan-gupta shreyan-gupta left a comment

Choose a reason for hiding this comment

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

Aah crap, will hit merge conflict with #12363

@Longarithm Longarithm added this pull request to the merge queue Nov 4, 2024
Merged via the queue into near:master with commit c83205b Nov 4, 2024
29 checks passed
@Longarithm Longarithm deleted the mt-mem-usages branch November 4, 2024 11:02
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