Skip to main content
QUICK REVIEW

[Paper Review] Fast and Simple Compact Hashing via Bucketing

Dominik Köppl, Simon J. Puglisi|arXiv (Cornell University)|Jan 1, 2020
Algorithms and Data CompressionComputer Science4 citations
TL;DR

This paper proposes a compact hash table that combines separate chaining with compact hashing to achieve high memory efficiency and fast insertion without storing displacement data. By using dynamic arrays for buckets and separating keys from values, the method reduces memory overhead while maintaining fast construction, outperforming prior compact hash tables in space and insertion speed for large satellite data on modern architectures.

ABSTRACT

Compact hash tables store a set S of n key-value pairs, where the keys are from the universe U = {0,…,u-1}, and the values are v-bit integers, in close to B(u, n) + nv bits of space, where {b(u, n)} = log₂ binom(u,n) is the information-theoretic lower bound for representing the set of keys in S, and support operations insert, delete and lookup on S. Compact hash tables have received significant attention in recent years, and approaches dating back to Cleary [IEEE T. Comput, 1984], as well as more recent ones have been implemented and used in a number of applications. However, the wins on space usage of these approaches are outweighed by their slowness relative to conventional hash tables. In this paper, we demonstrate that compact hash tables based upon a simple idea of bucketing practically outperform existing compact hash table implementations in terms of memory usage and construction time, and existing fast hash table implementations in terms of memory usage (and sometimes also in terms of construction time). A related notion is that of a compact Hash ID map, which stores a set Ŝ of n keys from U, and implicitly associates each key in Ŝ with a unique value (its ID), chosen by the data structure itself, which is an integer of magnitude O(n), and supports inserts and lookups on Ŝ, while using close to B(u,n) bits. One of our approaches is suitable for use as a compact Hash ID map.

Motivation & Objective

  • To address the memory inefficiency of traditional hash tables that either waste space (open addressing) or use extra pointers (separate chaining).
  • To eliminate the need for displacement information in compact hashing, which is typically required in open-addressing schemes to reconstruct keys.
  • To design a compact hash table that maintains high performance during construction while minimizing memory footprint.
  • To demonstrate that separate chaining can be a competitive approach in compact hashing when optimized for memory and modern cache hierarchies.

Proposed method

  • Uses separate chaining with dynamic arrays as buckets, storing keys and values in separate, equally sized arrays to improve cache locality.
  • Applies an injective function to map keys to quotient-remainder pairs, where the quotient is stored in the hash table and the remainder is derived from the key.
  • Employs a threshold bmax on bucket size to trigger table resizing when a bucket reaches capacity, doubling the number of buckets and redistributing elements.
  • Uses a two-phase construction: first, elements are inserted into buckets until bmax is reached; then, a new table with double the number of buckets is created and elements are migrated.
  • Optimizes memory layout by aligning buckets to cache lines and separating key and value arrays to improve data locality during lookups.
  • Leverages bit-parallel operations to accelerate quotient search in compact representations, using SIMD-style bit manipulation for efficient comparison of multiple quotients.

Experimental results

Research questions

  • RQ1Can separate chaining be made memory-efficient in compact hashing without storing displacement data, as required in open-addressing schemes?
  • RQ2How does the performance of a compact hash table based on separate chaining compare to existing compact hash tables in terms of insertion speed and memory usage?
  • RQ3What is the optimal bucket size threshold bmax that balances memory overhead and performance in dynamic resizing?
  • RQ4Can separating keys and values in distinct arrays improve cache efficiency and reduce lookup time in compact hash tables?
  • RQ5To what extent can bit-parallel techniques accelerate quotient lookup in compact representations of the hash table?

Key findings

  • Insertion performance is faster or uses less space than all previously known compact hash tables when storing sufficiently large satellite data on modern computer architectures.
  • The proposed method achieves a lower memory footprint during construction compared to existing compact hash tables, particularly benefiting from reduced pointer and metadata overhead.
  • The use of separate key and value arrays improves data locality, enhancing performance for large values and small keys.
  • The method eliminates the need for displacement information, simplifying the data structure and reducing complexity.
  • Resizing is performed incrementally by migrating entire buckets, avoiding the memory peak common in traditional dynamic arrays that reserve space for 3m elements during resize.
  • The approach is especially effective when the number of elements is large enough to justify the overhead of separate key and value arrays, making it suitable for applications with large satellite data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.