A fast and memory-efficient C++ hashmap implementation using robin hood hashing as a drop-in replacement for std::unordered_map/set.
robin_hood is a C++ hashmap library that implements unordered_map and unordered_set using robin hood hashing to deliver faster performance and lower memory consumption than std::unordered_map/set. It solves the problem of inefficient standard library hash containers by providing optimized data structures suitable for performance-sensitive applications.
C++ developers working on performance-critical systems, game engines, or applications where hash map speed and memory usage are bottlenecks, and those seeking a drop-in replacement for std::unordered_map/set.
Developers choose robin_hood for its proven speed and memory efficiency in benchmarks, its header-only simplicity, and its dual memory layout options that allow tuning for either maximum performance or reference stability.
Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Extensive benchmarks show robin_hood consistently outperforms std::unordered_map in speed and memory usage, making it ideal for performance-critical applications.
Offers unordered_flat_map for maximum speed with no indirection and unordered_node_map for stable references, allowing developers to tune based on their needs.
The bulk allocator minimizes memory allocations and reuses memory, preventing allocation spikes and improving performance in node-based maps.
As a single-header library, it's easy to integrate directly or via package managers like Conan, requiring minimal setup overhead.
The author has discontinued updates, only accepting critical bug fixes, and recommends using the successor ankerl::unordered_dense, limiting long-term support.
Poor hash functions can cause std::overflow_error and severe performance degradation, a vulnerability not present in the more forgiving std::unordered_map.
To achieve optimal performance or reference stability, developers must explicitly choose between flat or node layouts, as automatic selection may not be perfect.