starshard

Crates.iostarshard
lib.rsstarshard
version0.2.0
created_at2025-09-25 15:17:26.623822+00
updated_at2025-09-25 15:44:35.351766+00
descriptionA blazing-fast sharded concurrent HashMap using hashbrown and RwLock, with lazy shards, atomic length cache, and async support.
homepagehttps://houseme.github.io/starshard
repositoryhttps://github.com/houseme/starshard
max_upload_size
id1854752
size52,490
houseme (houseme)

documentation

https://docs.rs/starshard

README

Starshard

English | 简体中文

Build crates.io docs.rs License Downloads

A high-performance sharded concurrent HashMap for Rust, built on hashbrown and RwLock/tokio::sync::RwLock.

Features

  • Lazy shard initialization
  • O(1) atomic len
  • Optional parallel iteration with rayon
  • Async API with Tokio (feature async)
  • Pluggable hashers (default: fxhash)

Install

Add to Cargo.toml:

[dependencies]
starshard = { version = "0.1.0", features = ["rayon", "async"] }

Quick Start

use starshard::ShardedHashMap;
let map: ShardedHashMap<String, i32> = ShardedHashMap::new(64);
map.insert("k".into(), 1);
assert_eq!(map.get(&"k".into()), Some(1));

License

Dual-licensed under MIT or Apache-2.0.

  • See LICENSE-MIT and LICENSE-APACHE.
  • © 2025 houseme.
Commit count: 8

cargo fmt