fixedbitset
fixedbitset copied to clipboard
A simple bitset container for Rust
Moves all tests to their own module that is hidden behind a `#[cfg(test)]`, should speed up compilation time.
This PR adds the following optimizations and additions: * Changed Block to be a typedef on usize instead of u32, which should use 2x fewer instructions for similar length bit...
A good chunk of the platforms Rust works on supports SIMD instructions (see: core::arch's docs), this includes bitwise AND/OR/NOT operations for 128/256/512 bit types. It'd be great if operations across...
Allows syntax like `received[id] = true;`
Potential performance optimization for a pattern like this: ```rust if !received[id] { received[id] = true; // Do other stuff } // Could be this instead if !received.set(id, true) { //...
Here's a proof-of-concept. I've kept size arguments (in `len()`, `with_capacity()` and `grow()`) as `usize` to keep with the spirit of [typed-index-collections](https://github.com/zheland/typed-index-collections) *and* to be able to use it as a...
To use it as a drop-in replacement for `HashSet`, it would be nice to make `FixedBitSet` generic over its "index", i.e. `FixedBitSet where K: From + Into` (à la [typed-index-collections](https://lib.rs/crates/typed-index-collections))....
1. fixedbitset could be allocation free for small block counts (store blocks in a SmallVec) 2. fixedbitset could have a const constructor From [Bevy's ECS rework](https://github.com/bevyengine/bevy/pull/1525) notes. Figured I'd pass...
Hello, Thanks a lot for the awesome lib :+1: I've observed that `PartialEq` is [derived automatically](https://github.com/petgraph/fixedbitset/blob/4d6590f482b4510074fe4532dcee232293a4615a/src/lib.rs#L53). But that means that sets with different capacities are always considered different, even when...
Hi, I'm building a tiny abstraction over this lib for my use case (a set of `usize`s with an API very similar to `BTreeSet`) and I'm stuck on the implementation...