Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. robin-map

robin-map

MITC++v1.4.1

A C++ header-only library providing fast hash map and hash set implementations using robin hood hashing with open addressing.

GitHubGitHub
1.5k stars146 forks0 contributors

What is robin-map?

robin-map is a C++ library that provides fast hash map and hash set implementations using robin hood hashing. It solves the problem of slow hash table performance in standard library containers by offering optimized collision resolution, optional hash storage, and efficient serialization, making it suitable for high-performance applications.

Target Audience

C++ developers working on performance-critical systems, game engines, or data-intensive applications who need faster associative containers than `std::unordered_map` or `std::unordered_set`.

Value Proposition

Developers choose robin-map for its significant speed improvements, header-only design, and additional features like heterogeneous lookups and serialization, while maintaining compatibility with the familiar STL API.

Overview

C++ implementation of a fast hash map and hash set using robin hood hashing

Use Cases

Best For

  • High-performance applications requiring fast key-value lookups
  • Replacing `std::unordered_map` in performance-critical code
  • Scenarios where hash collisions must be minimized with prime growth policies
  • Systems needing efficient serialization of hash tables
  • Projects requiring exception-free compilation
  • Use cases benefiting from heterogeneous lookups (e.g., with smart pointers)

Not Ideal For

  • Projects requiring strict STL-compliant iterator invalidation guarantees (robin-map invalidates iterators on any modification)
  • Code relying on bucket-based operations like bucket_size or bucket, which are not supported
  • Applications with poor hash functions not using the prime growth policy, risking performance degradation from collisions
  • Situations where direct modification of map values through iterators is preferred without calling .value()

Pros & Cons

Pros

Header-Only Design

Simply add the include directory to your project; no compilation is required, making integration straightforward for C++17 projects.

High Performance Optimizations

Uses robin hood hashing with open addressing, benchmarked to show significant speed improvements over std::unordered_map, as documented in the provided benchmarks.

Heterogeneous Lookups

Supports find operations with types different from the key (e.g., pointers instead of smart pointers), reducing temporary object creation and improving flexibility.

Built-in Serialization

Provides efficient serialize and deserialize methods for saving and loading hash table data, with examples for integration using custom function objects.

Exception-Free Compatibility

Can be compiled without exceptions using -fno-exceptions or TSL_NO_EXCEPTIONS, making it suitable for environments where exceptions are disabled.

Cons

API Inconsistencies with STL

Iterators return const pairs, requiring .value() to modify values, and it lacks some std::unordered_map methods like bucket operations, deviating from standard expectations.

Performance Pitfalls with Bad Hashes

With power-of-two growth and poor hash functions, collisions can cause exponential storage growth without performance improvement, as admitted in the README's performance pitfalls section.

Inefficient Erasure in Sparse Tables

The erase() method can have quadratic runtime cost when the table has a low load factor, though erase_fast() is provided as an alternative to mitigate this.

Incomplete Documentation

The README states that 'All methods are not documented yet,' which may hinder adoption for developers needing comprehensive API references beyond the basics.

Frequently Asked Questions

Quick Stats

Stars1,505
Forks146
Contributors0
Open Issues9
Last commit2 months ago
CreatedSince 2017

Tags

#hash-table#high-performance#hash-set#data-structures#c-plus-plus#stl-alternative#serialization#hash-map#robin-hood-hashing#cpp#header-only

Built With

C
C++

Included in

C/C++70.6k
Auto-fetched 1 day ago

Related Projects

Parallel HashmapParallel Hashmap

A family of header-only, very fast and memory-friendly hashmap and btree containers.

Stars3,211
Forks312
Last commit3 months ago
CRoaringCRoaring

Roaring bitmaps in C (and C++), with SIMD (AVX2, AVX-512 and NEON) optimizations: used by Apache Doris, ClickHouse, Alibaba Tair, Redpanda, YDB and StarRocks

Stars1,879
Forks330
Last commit4 days ago
flat_hash_mapflat_hash_map

A very fast hashtable

Stars1,859
Forks207
Last commit2 years ago
robin-hood-hashingrobin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20

Stars1,621
Forks153
Last commit3 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub