HAMT is close in behavior to
std::hash_map. This permits using HAMT as the replacement
for it in the existing code for performance gains. However, because public interfaces
of different vendors for
std::hash_map differ, you might encounter problems should your
code depend on those differences. However, if your code doesn't override any
map template parameters that have default values, replacement should be seamless. It's also
possible to use HAMT instead of
std::map, but only if your code doesn't depend on
the iterator key ordering.
If your code uses heavy key-value mapping with long keys (longer than 32 symbols),
then HAMT is a good choice of an associative container. std::hash_map would also fit well for such task,
however, performance comparison shows advantage of HAMT over it.
std::map node from Microsoft has two char fields more than HAMT node. Depending on the
alignment set, this could be 2, 8, 16 or more bytes. std::map node from STLPort has one
field more, thus 1, 4, 8 or more bytes bigger. Thus, memory consumption of HAMT is of the same magnitude