efficient / libcuckoo

A high-performance, concurrent hash table
Other
1.62k stars 275 forks source link

How to integrate xxHash? #155

Closed poor1017 closed 1 year ago

poor1017 commented 1 year ago

Hi

This is a great and easy-to-use library!

Can you give me some advices?

  1. How to integrate xxHash?
  2. Does libcuckoo process collision internally? I need not to do this?

Thank you for you library!

manugoyal commented 1 year ago

Hi @poor1017.

  1. If you mean "how to integrate some arbitrary hash function", then this can be done by passing in a custom Hash functor to the class (https://github.com/efficient/libcuckoo/blob/e1d749174b550bd534cb96e4e82acb144c4ff3dc/libcuckoo/cuckoohash_map.hh#L45). It is the same interface as the C++ STL containers, such as std::unordered_map.
  2. Yes libcuckoo will handle hash collisions internally, and automatically resize the table if the load factor gets too high.

Hopefully this answers your questions!