4 ms·
For instance, the unordered_hash_map in C++ is based around a linked list of key/value pair buckets. This means iterating through the keys or values is very slo
by panic 9y ago
For instance, the unordered_hash_map in C++ is based around a linked list of key/value pair buckets. This means iterating through the keys or values is very slow (lots of cache misses!), but insertion is fast.
Has this changed recently? Last time I used unordered_map, insertion was also slow because it had to allocate a linked list entry for every item in the hash table.
- VHRanger 9y agoNo it's part of the standard. The STL guys can't implement it differently. Here are a few alternatives: MCT closed_hash_map Sparsehash's sparse_hash_map or dense_hash_map loki::assocvector boost::flat_hash_map