skarupke / flat_hash_map

A very fast hashtable
1.69k stars 186 forks source link

missing a fast_hash_map::merge #15

Open yvdriess opened 5 years ago

yvdriess commented 5 years ago

The merge() function in part of the std::unordered_map interface since C++17. https://en.cppreference.com/w/cpp/container/unordered_map/merge

Is there an implementation-specific trick that can speed up merging two fast_hash_map tables, compared to the iteration+insertion loop? This operation can be destructive to the source container.

Some context: I am dealing with a large amount of relatively small (~ 4kb, page size) tables that regularly get merged and cleared (without dealloc). This happens enough that the performance of the merge is critical.