DashMap
A blazing-fast concurrent HashMap for Rust that shards state across locks instead of using one global RwLock.
Repository Health
Technical Analysis
DashMap implements a concurrent associative array for Rust, designed as a near drop-in replacement for RwLock<HashMap<K, V>>. Instead of guarding the whole map behind a single lock, it shards entries across many internal locks, so concurrent readers and writers touching different keys rarely contend with each other.
All of DashMap’s methods take &self rather than &mut self, which means a DashMap can be wrapped in an Arc and shared across threads while still supporting in-place mutation — a pattern that’s awkward to express safely with the standard library’s HashMap alone. The crate builds on hashbrown for its underlying table implementation and parking_lot for its locking primitives, and offers optional serde and rayon integrations for serialization and parallel iteration.
What You Get
- A sharded concurrent HashMap and HashSet with an API closely mirroring
std::collections::HashMap - All methods take
&self, so the map works behind anArcwithout an outerMutex/RwLock - Built on
hashbrown(SwissTable-style hashing) andparking_lotfor low-overhead locking - Optional
rayonfeature for parallel iteration over entries - Optional
serdefeature for (de)serializing the map - A
raw-apifeature exposing lower-level shard access for advanced use cases
Common Use Cases
- Shared in-memory caches accessed concurrently from multiple async tasks or threads
- Connection/session registries in servers where many threads insert, update, and evict entries
- Counters, rate-limiter state, or metrics maps updated from parallel workers
- Replacing a
Mutex<HashMap<_, _>>orRwLock<HashMap<_, _>>bottleneck identified via profiling
Under The Hood
Architecture — DashMap’s core (lib.rs) partitions the map into a fixed number of shards, each an independent hashbrown table guarded by its own parking_lot::RwLock; a key’s shard is selected by hashing, so operations against different shards proceed with no contention. mapref/setref modules provide guard types (Ref/RefMut) that hold a shard’s lock for the lifetime of the borrow, giving reference-like ergonomics without exposing the underlying lock directly. Tech Stack — pure Rust (2021 edition, MSRV 1.70), built on hashbrown for its table implementation, parking_lot/lock_api for lighter-weight locks than the stdlib’s, crossbeam-utils for cache-line padding to avoid false sharing between shards, and optional rayon/serde/arbitrary/typesize integrations behind Cargo features. Code Quality — set.rs and read_only.rs reuse the same sharded-map core to offer a DashSet and a read-only view without duplicating logic; the crate has shipped 60+ releases since 2019, though recent commit activity is low (health-score data shows low recent development activity despite the project’s maturity and continued adoption). API Design — the public API deliberately mirrors std::collections::HashMap (get, insert, remove, entry, iter) so existing HashMap code ports over with minimal changes, and the key ergonomic difference — all methods taking &self instead of &mut self — is called out prominently in the README specifically so users understand why the map is safe to share via Arc without an outer lock.
Used by 19 apps in this directory
Cog
AI Development · Devops · Developer Tools
An open-source CLI that packages machine learning models into standard, production-ready Docker containers — no Dockerfile wrangling, no CUDA version hell.
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
DevTools-X
Developer Tools
41 offline-first developer utilities in a single 10MB cross-platform desktop app — no Electron, no cloud, no compromise.
headroom
AI Development · Developer Tools
Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.
Hook0
Devops
Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.
Hoppscotch
Developer Tools
A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.
iii
Developer Tools · Devops
Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.
InfluxDB
Databases · Analytics
Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.
Laminar
AI Development · Monitoring
Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.