Open-sourcing F14 for memory-efficient hash tables
1–10 of 50 posts
Re: Open-sourcing F14 for memory-efficient hash tables
#2Re: Open-sourcing F14 for memory-efficient hash tables
#3Re: Open-sourcing F14 for memory-efficient hash tables
#4There was a discussion thread on here recently about Google's Hash Table implementation. I wonder how the approaches and design considerations compare to each other.
Edit: Or at least I think that's relevant to this announcement. I don't know enough about it to say for sure.
Re: Open-sourcing F14 for memory-efficient hash tables
#5I do wish it could be used header-only out of the box, but still a great library.
Re: Open-sourcing F14 for memory-efficient hash tables
#6You can't win them all, I guess…
Also, TIL that invalidating iterators does not actually invalidate references to keys and values:
> The standard guarantees reference stability: References and pointers to the keys and values in the hash table must remain valid until the corresponding key is removed.
Re: Open-sourcing F14 for memory-efficient hash tables
#7https://github.com/facebook/folly/commit/93d49bcf9a44d6b2d9c...
Re: Open-sourcing F14 for memory-efficient hash tables
#8Re: Open-sourcing F14 for memory-efficient hash tables
#9I've recently started using Folly's F14 hash map implementation (specifically, F14ValueMap--my keys and values are relatively compact) and it's the fastest unordered associative container I've yet found. This is for an application that repeatedly adds to and removes from the map. In particular, it's faster than a custom solution using open addressing that I had written that is pretty much optimal for this particular…
Re: Open-sourcing F14 for memory-efficient hash tables
#10I've recently started using Folly's F14 hash map implementation (specifically, F14ValueMap--my keys and values are relatively compact) and it's the fastest unordered associative container I've yet found. This is for an application that repeatedly adds to and removes from the map. In particular, it's faster than a custom solution using open addressing that I had written that is pretty much optimal for this particular…
Have you compared to ska::flat_hash_map or khash? I’ve found the latter to be ideal if my keys/values were POD and the former otherwise. I’m not yet convinced that it’s actually better based on their website. std::unordered_map is infamously slow.
For my application, the problem with implementations that use more traditional tombstone algorithms is that removing items from the table doesn't decrease the load, so that at some point the entire table has to be recreated. For my application, worst case performance is far more important than average performance.
dense_hash_map definitely behaves as described above, and (from a quick look at the code) I believe khash does as well.
I haven't looked at ska::flat_hash_map but thanks for the tip.