On Jul 2, 2015, at 4:20 AM, Dumitrescu, Cristian <cristian.dumitrescu at 
intel.com> wrote:
> I am wondering how can I use the hash library if I don't know the number
> of entries in the bucket (number of entries in the bucket can grow
> dynamically)
> I am trying to use the DPDK hash library for MAC table where I can't give
> the fixed number of elements in each bucket.

Another thing to keep in mind. DPDK hashes have an extremely large number of 
shallow buckets and pretty good spreading hash functions, This is for 
performance reasons to minimize the amount of cacheline loads. The chances of 
evicting buckets in this sort of hash table aren't really all that high so 
worrying about this might be overkill.

If you want a good quality hash table for weird stuff like variable-length 
keys, deeper buckets to guarantee items are preserved, etc., what I ended up 
doing was combining uthash with jemalloc in my app (you could also use 
rte_malloc but I didn't want to complicate the app too much until I get it 
feature complete and begin tuning it).

https://troydhanson.github.io/uthash/
https://github.com/troydhanson/uthash

http://www.canonware.com/jemalloc/
https://github.com/jemalloc/jemalloc

Matthew.

Reply via email to