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

AcctIdx: StoredSize is u32 #21894

Merged
merged 1 commit into from
Dec 14, 2021
Merged

Conversation

jeffwashington
Copy link
Contributor

@jeffwashington jeffwashington commented Dec 14, 2021

Problem

max acct data len is 10M. So, max acct size in append vec is not much bigger than that. We don't need a usize to store 0-~10M. u32 works great.

Summary of Changes

Reduce in-mem AccountInfo.stored_size to u32 to reduce memory use (and disk-bucket disk use) of AcctIdx.
Fixes #

brooksprumo
brooksprumo previously approved these changes Dec 14, 2021
Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

lgtm

runtime/src/accounts_db.rs Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #21894 (3a3ffdc) into master (a400b5e) will decrease coverage by 0.0%.
The diff coverage is 76.0%.

❗ Current head 3a3ffdc differs from pull request most recent head 1f31e99. Consider uploading reports for the commit 1f31e99 to get more accurate results

@@            Coverage Diff            @@
##           master   #21894     +/-   ##
=========================================
- Coverage    81.3%    81.3%   -0.1%     
=========================================
  Files         516      516             
  Lines      144033   144220    +187     
=========================================
+ Hits       117139   117263    +124     
- Misses      26894    26957     +63     

@jeffwashington jeffwashington marked this pull request as ready for review December 14, 2021 19:08
@mergify mergify bot dismissed brooksprumo’s stale review December 14, 2021 19:29

Pull request has been modified.

@jeffwashington jeffwashington merged commit f4308bd into solana-labs:master Dec 14, 2021
jeffwashington added a commit to jeffwashington/solana that referenced this pull request Dec 14, 2021
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