An extremely memory-efficient hash_map implementation. 2 bits/entry overhead! The SparseHash library contains several hash-map implementations, including implementations that optimize for space or speed.
These hashtable implementations are similar in API to SGI's hash_map class and the tr1 unordered_map class, but with different performance characteristics. It's easy to replace hash_map or unordered_map by sparse_hash_map or dense_hash_map in C++ code.
Recent news:
I've just released sparsehash 1.7. The major news here is the addition of Allocator support. Previously, these hashtable classes would just ignore the Allocator template parameter. They now respect it, and even inherit size_type, pointer, etc. from the allocator class. By default, they use a special allocator we provide that uses libc malloc and free to allocate. The hash classes notice when this special allocator is being used, and use realloc when it can. This means that the default allocator is significantly faster than custom allocators are likely to be (since realloc-like functionality is not supported by STL allocators).
There are a few more minor changes as well. A full list of changes is described in the ChangeLog.
I've just released sparsehash 1.6. The API has widened a bit with the addition of deleted_key() and empty_key(), which let you query what values these keys have. A few rather obscure bugs have been fixed (such as an error when copying one hashtable into another when the empty_keys differ). A full list of changes is described in the ChangeLog.
I've just released sparsehash 1.5.1. Hot on the heels of sparsehash 1.5, this release fixes a longstanding bug in the sparsehash code, where equal_range would always return an empty range. It now works as documented. All sparsehash users are encouraged to upgrade.
I've just released sparsehash 1.5. This release introduces tr1 compatibility: I've added rehash, begin(i), and other methods that are expected to be part of the unordered_map API once tr1 in introduced. This allows sparse_hash_map, dense_hash_map, sparse_hash_set, and dense_hash_set to be (almost) drop-in replacements for unordered_map and unordered_set.
There is no need to upgrade unless you need this functionality, or need one of the other, more minor, changes described in the ChangeLog.