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

feat(katana-db): integer set using roaring bitmap #1775

Merged
merged 6 commits into from
Apr 6, 2024
Merged

Conversation

kariy
Copy link
Member

@kariy kariy commented Apr 5, 2024

Related #1762

Introduces an IntegerSet struct for storing a list of block numbers.

We use Roaring bitmap data structure as they provide better compression compared to a naive Vec when storing the same amount of elements.


Storing 1_000_000 u64s:

  • roaring bitmap = 131.22KB
  • vec = 8MB

@kariy
Copy link
Member Author

kariy commented Apr 5, 2024

@kariy kariy changed the title add roaring bitmap based integer list feat(katana-db): integer list using roaring bitmap Apr 5, 2024
@kariy kariy changed the title feat(katana-db): integer list using roaring bitmap feat(katana-db): integer set using roaring bitmap Apr 5, 2024
@kariy kariy changed the title feat(katana-db): integer set using roaring bitmap feat(katana-db): integer list using roaring bitmap Apr 5, 2024
@kariy kariy added the katana This issue is related to Katana label Apr 5, 2024
@kariy kariy marked this pull request as ready for review April 5, 2024 10:03
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 67.46%. Comparing base (b286efb) to head (650fc94).

Files Patch % Lines
crates/katana/storage/db/src/models/list.rs 68.42% 6 Missing ⚠️
...es/katana/storage/provider/src/providers/db/mod.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1775      +/-   ##
==========================================
- Coverage   67.47%   67.46%   -0.01%     
==========================================
  Files         305      306       +1     
  Lines       33560    33554       -6     
==========================================
- Hits        22644    22637       -7     
- Misses      10916    10917       +1     

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

@kariy kariy changed the title feat(katana-db): integer list using roaring bitmap feat(katana-db): integer set using roaring bitmap Apr 5, 2024
Base automatically changed from change-dupsort to main April 6, 2024 01:36
@kariy kariy merged commit 1c90f0f into main Apr 6, 2024
12 checks passed
@kariy kariy deleted the roaring-bitmap branch April 6, 2024 02:49
kariy added a commit that referenced this pull request Apr 24, 2024
bump database version to `1` for the next release due to breaking changes introduced in #1773, #1774, #1775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
katana This issue is related to Katana
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant