| Crates.io | fastbit |
| lib.rs | fastbit |
| version | 0.11.1 |
| created_at | 2025-05-23 07:15:36.5883+00 |
| updated_at | 2025-06-05 10:21:27.180879+00 |
| description | A fast, efficient, and pure Rust bitset implementation for high-performance data indexing and analytics. |
| homepage | https://github.com/enterprise-search/fastbit |
| repository | https://github.com/enterprise-search/fastbit |
| max_upload_size | |
| id | 1685974 |
| size | 212,476 |
FastBit is a high-performance data indexing and querying library written in Rust, designed for fast analytics on large datasets. It provides one of the fastest bit vector implementations available in the Rust ecosystem.
FastBit is designed for raw speed with operation-specific optimizations:
any() on specific bit patternsVec<bool> while maintaining high performanceBenchmark highlights:
Add FastBit to your Cargo.toml:
[dependencies]
fastbit = "0.1"
Or clone the repository:
git clone https://github.com/enterprise-search/fastbit.git
cd fastbit
cargo build --release
FastBit offers significant performance advantages over other bit vector libraries:
When compared to alternatives like the bitvec crate, FastBit offers:
// For most operations, use u64 as the word type
use fastbit::{BitVec, BitRead, BitWrite};
// Create a bit vector with 128 bits
let mut bv: BitVec<u64> = BitVec::new(128);
bv.set(5);
assert!(bv.test(5));
bv.reset(5);
assert!(!bv.test(5));
// Efficient bulk operations
bv.fill(); // Set all bits to 1
assert!(bv.all());
bv.clear(); // Set all bits to 0
assert!(!bv.any());
// For iteration-heavy workloads with dense bit vectors, consider u8
let mut dense_bv: BitVec<u8> = BitVec::new(128);
dense_bv.fill(); // Fill with 1s for dense bit vector
// Iteration over dense_bv will be faster than with u64
Contributions are welcome! Please open issues or submit pull requests.
This project is licensed under the MIT License.