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

Single bitmap implementation for different special cases #157

Open
eugene-babichenko opened this issue Nov 18, 2019 · 3 comments
Open

Single bitmap implementation for different special cases #157

eugene-babichenko opened this issue Nov 18, 2019 · 3 comments

Comments

@eugene-babichenko
Copy link
Contributor

Now there are two different implementations of bitmaps:

  • One in imhamt (32 bits long)
  • Another one in sparse-array (256 bits long)

We need to implement a bitmap that will satisfy different corner-cases (8, 16, ... 256 bits) and be reusable so that we can remove functionality duplication.

@eugene-babichenko eugene-babichenko changed the title Single bitmap for different special cases Single bitmap implementation for different special cases Nov 18, 2019
@mzabaluev
Copy link
Contributor

mzabaluev commented Nov 18, 2019

There may be a performance benefit in keeping at least these two implemented differently, as the first one fits within u32 and the other needs to be backed by an array.

@eugene-babichenko
Copy link
Contributor Author

Instead we can implement u256 and use something like PrimInt trait from the num crate: struct Bitmap<T: PrimInt>(T).

@NicolasDP
Copy link
Contributor

which reminds me: https://crates.io/crates/uint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants