75 points · by jsnell · 6y ago · 17 comments
[1] https://abseil.io/about/design/swisstables
[2] https://github.com/facebook/folly/blob/master/folly/containe...
In their "Conclusion" section, they write:
"We thus propose Cuckoo++ which adds a bloom filter in the primary bucket, allowing to prune unnecessary accesses to the secondary bucket without requiring expensive computation. Cuckoo++ hash tables have a uniformly good performance when compared to both pessimistic and optimistic implementation, and an improved performance over DPDK and Horton tables for all cases.
We also describe a variant of Cuckoo++ that integrate support for entry expiration directly in the hash table, avoiding the need for external management of timers and the associated overheads. This relies on a new memory layout more compact than DPDK’s original one, and on the use of 16-bit timestamp."
That seems to imply that the timer/expiration feature is an optional added bonus, rather than a core feature of Cuckoo++.
But in the case of flow-tracking, many more memory accesses would be needed to organise a heap or timer wheel, so that's where the main win is, compared to an incremental improvement on bucketized cuckoo / horton.
Edit: as child comment points out, this is a visualization of normal cuckoo hashing, not cuckoo++ that this paper describes.
From the paper: "we describe algorithmical changes to cuckoo hash tables allowing a more efficient implementation. More precisely, our hash table adds a bloom filter in each bucket that allows to prune unnecessary lookups to the secondary bucket."
Incoming packets are hashed by their 5-tuple and divided among CPUs and a thread is capturing traffic on each CPU and works independently of the others.
Edit: so the answer is that the question if thread safety isn't addressed, since it doesn't arise in the intended use-case. But I'm sure it could be added with per-bucket locking since it is based on cuckoo hash.
https://www.usenix.org/conference/atc18/presentation/andre
So yes, very much a system architecture with no locking or sharing.