-
-
Notifications
You must be signed in to change notification settings - Fork 301
Description
Hello @greg7mdp
as always many thanks for this very useful tool.
I have a question about the internal bucket counts that relates to efficiency. It is my understanding that if the number of buckets is a prime number, even with bad hash function, one can get a very good/near perfect distribution in the buckets. This is especially useful when the inputs are unpredictable.
However, apparently it is impossible to set the number of buckets to achieve this very useful feature in unordered_map (and therefore I guess in parallel-hashmap) because we can only set the minimum number of buckets with rehash: https://cplusplus.com/reference/unordered_map/unordered_map/rehash/
Is there a reason for this? It sounds like have a defined number of buckets that allows this trick with prime numbers would allow for significant improvements in efficiency.
Thanks!