High Performance Construction of RecSplit Based Minimal Perfect Hash Functions

12/19/2022
by   Dominik Bez, et al.
0

A minimal perfect hash function (MPHF) is a bijection from a set of objects S to the first |S| integers. It can be used as a building block in databases and data compression. RecSplit [Esposito et al., ALENEX20] is currently the most space efficient practical minimal perfect hash function. Its main building blocks are splittings and bijections. Using a tree-like data structure, RecSplit first splits the input set into small sets of constant size l and then computes a bijection on each leaf. Both splittings and bijections heavily rely on trying multiple hash functions in a brute-force way. We greatly improve the construction time of RecSplit using two orthogonal approaches. On the one hand, we explore the trade-off between (exponential time) brute force and more informed (polynomial time) search heuristics. Rotation fitting hashes the objects in each leaf to two sets and tries to combine them to a bijection by cyclically shifting one set to fill the holes in the other. ShockHash constructs a small cuckoo hash table in each leaf, which is overloaded to hold more objects than the asymptotic maximum. On the other hand, we harness parallelism on the level of bits, vectors, cores, and GPUs. In combination, the resulting improvements yield speedups up to 241 on a CPU and up to 2072 using a GPU. The original RecSplit implementation needs 19 minutes to construct an MPHF for 1 Million objects with 1.56 bits per object. On the GPU, we achieve the same space usage in 1.5 seconds. Given that the speedups are larger than the increase in energy consumption, our implementation is more energy efficient than the original implementation. As a result, our improved RecSplit implementation is now the approach to perfect hashing with the fastest construction time over a wide range of space budgets. Surprisingly, this even holds for rather high space budgets where asymptotically faster methods are available.

READ FULL TEXT

page 13

page 18

research
10/04/2022

SicHash – Small Irregular Cuckoo Tables for Perfect Hashing

A Perfect Hash Function (PHF) is a hash function that has no collisions ...
research
08/18/2023

ShockHash: Towards Optimal-Space Minimal Perfect Hashing Beyond Brute-Force

A minimal perfect hash function (MPHF) maps a set S of n keys to the fir...
research
05/10/2022

PaCHash: Packed and Compressed Hash Tables

We introduce PaCHash, a hash table that stores its objects contiguously ...
research
11/22/2019

Constructing Minimal Perfect Hash Functions Using SAT Technology

Minimal perfect hash functions (MPHFs) are used to provide efficient acc...
research
04/21/2021

PTHash: Revisiting FCH Minimal Perfect Hashing

Given a set S of n distinct keys, a function f that bijectively maps the...
research
06/04/2021

Parallel and External-Memory Construction of Minimal Perfect Hash Functions with PTHash

A minimal perfect hash function f for a set S of n keys is a bijective f...
research
10/24/2022

Locality-Preserving Minimal Perfect Hashing of k-mers

Minimal perfect hashing is the problem of mapping a static set of n dist...

Please sign up or login with your details

Forgot password? Click here to reset