acmap is an actor-style, sharded async map for Rust, built on tokio channels.
It provides a DashMap-like API surface for common operations, with two write paths:
insert: request/response write (returns previous value)insert_fast: fire-and-forget write for high-throughput scenarios
- Sharded actor model for parallel write handling
- Async API for map operations
- Fast-path write API for lower overhead
- Simple benchmark example in
examples/benchmark.rs
Add to your Cargo.toml:
[dependencies]
acmap = { path = "." }use acmap::AcMap;
#[tokio::main]
async fn main() {
let map = AcMap::<u64, u64>::new();
assert_eq!(map.insert(1, 10).await, None);
assert_eq!(map.get(1).await, Some(10));
map.insert_fast(2, 20);
assert!(map.contains_key(2).await);
assert_eq!(map.len().await, 2);
}cargo test -q
cargo run --example benchmark -qsrc/acmap/mod.rs: public API and sharding logicsrc/acmap/messages.rs: actor message definitionssrc/acmap/shard.rs: shard actor runtime loopexamples/benchmark.rs: benchmark-like demo
This project is licensed under the MIT License.