Hopscotch Hashing

  • Maurice Herlihy
  • Nir Shavit
  • Moran Tzafrir
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5218)

Abstract

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.

Keywords

Hash Table Cache Line Empty Slot Free Dist Multicore Machine 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)MATHGoogle Scholar
  2. 2.
    Lea, D.: Personal communication (January 2003)Google Scholar
  3. 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
  4. 4.
    Pagh, R., Rodler, F.F.: Cuckoo hashing. Journal of Algorithms 51(2), 122–144 (2004)MATHCrossRefMathSciNetGoogle Scholar
  5. 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. 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/
  7. 7.
    Shalev, O., Shavit, N.: Split-ordered lists: Lock-free extensible hash tables. Journal of the ACM 53(3), 379–405 (2006)CrossRefMathSciNetGoogle Scholar
  8. 8.
    Purcell, C., Harris, T.: Non-blocking hashtables with open addressing. In: Fraigniaud, P. (ed.) DISC 2005. LNCS, vol. 3724, pp. 108–121. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  9. 9.
    Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann, NY (2008)Google Scholar
  10. 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

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Maurice Herlihy
    • 1
  • Nir Shavit
    • 2
    • 3
  • Moran Tzafrir
    • 3
  1. 1.Brown UniversityProvidence
  2. 2.Sun MicrosystemsBurlington
  3. 3.Tel-Aviv UniversityTel-AvivIsrael

Personalised recommendations