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

reworks blockstore ColumnIndexDeprecation trait #4460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

behzadnouri
Copy link

Problem

Unnecessary heap allocations in ColumnIndexDeprecation implementations:
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L932
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L1005
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L1075

Summary of Changes

Similar to #4416 in order to add more type-safety and avoid unnecessary heap allocations the commit removes

const DEPRECATED_INDEX_LEN: usize;

from ColumnIndexDeprecation trait and instead adds:

type DeprecatedKey: AsRef<[u8]>;

@behzadnouri behzadnouri changed the title rewords blockstore ColumnIndexDeprecation trait reworks blockstore ColumnIndexDeprecation trait Jan 14, 2025
@behzadnouri behzadnouri force-pushed the bs-column-depr-key branch 2 times, most recently from 6f8b9c9 to eb7aedb Compare January 14, 2025 17:40
@behzadnouri behzadnouri requested a review from steviez January 14, 2025 18:52
Similar to
    anza-xyz#4416
in order to add more type-safety and avoid unnecessary heap allocations:
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L932
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L1005
https://github.com/anza-xyz/agave/blob/8a0c9b461/ledger/src/blockstore_db.rs#L1075

the commit removes
    const DEPRECATED_INDEX_LEN: usize;
from ColumnIndexDeprecation trait and instead adds:
    type DeprecatedKey: AsRef<[u8]>;
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