# sparsehash/sparsehash

C++ associative containers

Repository: https://github.com/sparsehash/sparsehash
Canonical: https://ross.abutalabs.com/products/sparsehash
Language: C++
License: BSD-3-Clause
License Family: permissive
Last push: 2021-11-30T02:30:00+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4037, "days_push": 1738, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1599, forks 260 (observed 2026-08-28T04:05:09.493587+00:00)

## What it is
A C++ library providing sparse_hash_map, dense_hash_map, and their set counterparts — hash-based associative containers with SGI hash_map-compatible APIs but different space/speed tradeoffs. sparse variants use only 1-2 bits of overhead per entry, while dense variants optimize lookup speed.

## Use cases
- store huge hash maps with minimal memory overhead
- fast hash map lookups in C++
- replace std::unordered_map with a space-efficient alternative
- serialize hash maps to disk
- use hash sets with low per-entry overhead

## When to choose
- memory footprint is critical for very large hash tables
- you need faster lookups than std::unordered_map and can tolerate API quirks like empty/deleted key reservation
- you want a mature, header-based C++ hashtable with I/O support

## When to avoid
- you need a modern, actively maintained container — prefer absl::flat_hash_map or std::unordered_map
- your keys cannot reserve sentinel empty/deleted values
- you need rich iterator semantics or C++ standard compliance

## Facets
- artifact type: library
- maturity: maintenance
- function: caching, serialization, developer-tools
- domain: performance, developer-tools
- platform: cpp, windows, cross-platform
- tags: hash-map, hash-set, associative-containers, hashtable, memory-efficient, header-only, algorithms, linux, macos

## Member repositories
- sparsehash/sparsehash (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:09.493587+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:53:14.580256+00:00, confidence not recorded.
  - readme: https://github.com/sparsehash/sparsehash (fetched 2026-08-28T04:05:09.493587+00:00, sha 22c0869c6826)
- Data as of 2026-08-30T08:39:29.467469+00:00.
