| Crates.io | pithanos |
| lib.rs | pithanos |
| version | 0.2.0 |
| created_at | 2025-10-26 20:57:25.607265+00 |
| updated_at | 2025-12-08 00:13:50.954893+00 |
| description | Fast, lock-free probabilistic data structures for modern Rust. |
| homepage | https://github.com/Pranish-Pantha/pithanos |
| repository | https://github.com/Pranish-Pantha/pithanos |
| max_upload_size | |
| id | 1901865 |
| size | 45,202 |
⚡ Fast, lock-free probabilistic data structures for modern Rust. Includes Bloom Filter and Count-Min Sketch implementations optimized for speed and concurrency.
| Feature | Description |
|---|---|
| 🧩 Bloom Filter | Approximate set membership check |
| 📊 Count-Min Sketch | Approximate frequency estimation |
| ⚙️ No global locks | Thread-safe access with atomic operations, fast deterministic hashing (xxhash) |
| 📦 Modular design | Shared internal traits and utilities, clean module structure |
| 🧪 Benchmark suite | Criterion-based microbenchmarks for queries |
Add this to your Cargo.toml:
[dependencies]
pithanos = "0.1"
use pithanos::bloom::BloomFilter;
fn main() {
let filter = BloomFilter::new(1000, 3); // 1000 bits, 3 hash functions
filter.insert(&"foo");
filter.insert(&"bar");
assert!(filter.contains(&"foo"));
assert!(!filter.contains(&"bar"));
}
use pithanos::cms::CountMinSketch;
fn main() {
let cms = CountMinSketch::new(1000, 3); // wdith 100, depth 3
cms.increment(&"foo", 3);
cms.increment(&"bar", 1);
println!("Frequency of 'foo': {}", cms.frequency(&"foo"));
println!("Frequency of 'bar': {}", cms.frequency(&"bar"));
}
Pithanos uses criterion for micro-benchmarks.
Run all benchmarks with cargo bench
Pithanos (πιθανός) — Ancient Greek: “likely,” “probable,” or “plausible.”
Inspired by RedisBloom