hashbrown
Rust port of Google's SwissTable hash map, the engine behind std's HashMap
Repository Health
Technical Analysis
hashbrown is a Rust implementation of Google’s SwissTable hash map design, built as a drop-in replacement for the standard library’s HashMap and HashSet. Since Rust 1.36 the standard library itself has adopted this implementation internally, but the standalone crate remains essential for #[no_std] environments — embedded systems and kernels — where the standard library isn’t available.
Compared to a naive hash table, hashbrown uses SIMD-accelerated lookups to scan multiple entries in parallel, only one byte of per-entry overhead instead of eight, and allocates no memory for empty maps, delivering roughly 2x the throughput of the pre-SwissTable standard library HashMap.
What You Get
- Drop-in
HashMapandHashSettypes API-compatible with the Rust standard library’s collections - SIMD-accelerated lookups that scan multiple hash table slots in parallel
- Only one byte of per-entry metadata overhead versus eight bytes in naive designs
#[no_std]compatibility (with a global allocator) for embedded systems and kernels- Optional serde, rayon parallel-iterator, and custom-equivalence (
Equivalenttrait) integrations via Cargo features
Common Use Cases
- Using a fast, low-overhead hash map in
#[no_std]embedded or kernel code where std collections aren’t available - Squeezing extra performance out of hot-path hash map lookups in latency-sensitive Rust services
- Building custom hashing-based data structures on top of hashbrown’s lower-level raw table API
- Serializing/deserializing hash maps with serde support enabled via the
serdefeature flag
Under The Hood
Architecture - The crate’s core is a raw SIMD-aware hash table (src/raw and table.rs, ~3,200 lines) that implements SwissTable’s group-probing scheme, with HashMap/HashSet built as thin, std-API-compatible wrappers over that raw table; foldhash is used as the fast default hasher, replacing SipHash for non-adversarial workloads. Tech Stack - Nearly pure Rust (99%+), gated behind Cargo feature flags for nightly (unstable optimizations), serde, rayon parallel iterators, raw-entry, and allocator-api2 support, with a CI matrix (ci/ directory, Cross.toml) validating multiple targets and toolchains including no_std configurations. Code Quality - Extensive integration tests (tests/set.rs, tests/serde.rs, tests/rayon.rs, tests/hasher.rs, tests/hasher_unwind.rs, tests/equivalent_trait.rs) plus dedicated benchmark suites (benches/) validate both correctness and performance; the project is one of the most heavily reviewed crates in the Rust ecosystem given its role inside std itself. API Design - The public API deliberately mirrors std::collections::HashMap/HashSet method-for-method, so migrating existing code is close to a drop-in import swap, while advanced users can drop to the raw table API for custom hashing schemes.
Used by 8 apps in this directory
agentgateway
AI Development · Developer Tools
An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.
Cap
Team Chat · Video Conferencing
Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.
Fyrox
Game Development
A production-ready 2D/3D game engine written in Rust with a built-in scene editor, physics, and hot-reloading game scripts
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.
Meilisearch
Search
Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.
monty
AI Development · Developer Tools
Run LLM-generated Python code safely inside your agent—no containers, no CPython, no compromise—with sub-microsecond startup.
Murr
Databases
A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.
Sonic
Databases · Search
Fast, lightweight, schema-less search backend in Rust — microsecond queries, 30MB RAM, no document storage required.