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

Optimizes AppendVec::get_account_sizes() when using file io #2083

Merged

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Jul 10, 2024

Problem

As noted in #1394 (comment), when using file i/o to access append vecs, the get_account_sizes() implementation is not optimal. It currently calls get_stored_account_meta_callback(), which will copy all the account fields—including the data—even though only the data len is needed.

We call get_account_sizes() from clean when removing dead accounts inside handle_reclaims(), so having a more-optimal impl is beneficial.

Summary of Changes

Only get the data len from each account.

@brooksprumo brooksprumo self-assigned this Jul 10, 2024
@brooksprumo brooksprumo force-pushed the append-vec/get-account-sizes/impl branch from 467af35 to 25fb45c Compare July 10, 2024 20:10
@brooksprumo brooksprumo force-pushed the append-vec/get-account-sizes/impl branch from 25fb45c to 180c69f Compare July 10, 2024 21:54
@brooksprumo brooksprumo marked this pull request as ready for review July 11, 2024 12:07
@brooksprumo brooksprumo requested a review from HaoranYi July 11, 2024 12:07
@brooksprumo brooksprumo requested a review from HaoranYi July 11, 2024 16:05
Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm

@brooksprumo brooksprumo merged commit 6d30530 into anza-xyz:master Jul 11, 2024
40 checks passed
@brooksprumo brooksprumo deleted the append-vec/get-account-sizes/impl branch July 11, 2024 17:43
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