We present a new class of resizable sequential and concurrent hash map algorithms directed at both uni-processor and multicore machines. The new hopscotch algorithms are based on a novel hopscotch multi-phased probing and displacement technique that has the flavors of chaining, cuckoo hashing, and linear probing, all put together, yet avoids the limitations and overheads of these former approaches. The resulting algorithms provide tables with very low synchronization overheads and high cache hit ratios.
In a series of benchmarks on a state-of-the-art 64-way Niagara II multicore machine, a concurrent version of hopscotch proves to be highly scalable, delivering in some cases 2 or even 3 times the throughput of today’s most efficient concurrent hash algorithm, Lea’s ConcurrentHashMap from java.concurr.util. Moreover, in tests on both Intel and Sun uni-processor machines, a sequential version of hopscotch consistently outperforms the most effective sequential hash table algorithms including cuckoo hashing and bounded linear probing.
The most interesting feature of the new class of hopscotch algorithms is that they continue to deliver good performance when the hash table is more than 90% full, increasing their advantage over other algorithms as the table density grows.
KeywordsHash Table Cache Line Empty Slot Free Dist Multicore Machine
Unable to display preview. Download preview PDF.
- 2.Lea, D.: Personal communication (January 2003)Google Scholar
- 3.Knuth, D.E.: The art of computer programming. In: Fundamental algorithms, 3rd edn. Addison Wesley Longman Publishing Co., Inc., Redwood City (1997)Google Scholar
- 5.Gonnet, G.H., Baeza-Yates, R.: Handbook of algorithms and data structures: in Pascal and C, 2nd edn. Addison-Wesley Longman Publishing Co., Inc., Boston (1991)Google Scholar
- 6.Lea, D.: Hash table util.concurrent.concurrenthashmap in java.util.concurrent the Java Concurrency Package, http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/-jsr166/-src/main/java/util/concurrent/
- 9.Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann, NY (2008)Google Scholar
- 10.Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free synchronization: Double-ended queues as an example. In: ICDCS 2003: Proceedings of the 23rd International Conference on Distributed Computing Systems, p. 522. IEEE Computer Society, Washington (2003)Google Scholar