Fast and scalable minimal perfect hashing for massive key sets

Antoine Limasset, Guillaume Rizk, Rayan Chikhi, Pierre Peterlongo
2/10/2017
108 citations
cs.DS

Official code: rizkg/BBHash (281 stars, C++, MIT, last commit 2025-07-16).

Abstract

Minimal perfect hash functions provide space-efficient and collision-free hashing on static sets. Existing algorithms and implementations that build such functions have practical limitations on the number of input elements they can process, due to high construction time, RAM or external memory usage.

Show full abstract

We revisit a simple algorithm and show that it is highly competitive with the state of the art, especially in terms of construction time and memory usage. We provide a parallel C++ implementation called BBhash. It is capable of creating a minimal perfect hash function of $10^{10}$ elements in less than 7 minutes using 8 threads and 5 GB of memory, and the resulting function uses 3.7 bits/element. To the best of our knowledge, this is also the first implementation that has been successfully tested on an input of cardinality $10^{12}$. Source code: https://github.com/rizkg/BBHash

View on arXivView PDF

Code Implementations(1)

rizkg/BBHashOfficial100%
MIT

Bloom-filter based minimal perfect hash function library

28131C++, MakefileNov 30, 20151 years agoMIT

Similar Papers

Cite this paper

@article{limasset2017fast,
  title  = {Fast and scalable minimal perfect hashing for massive key sets},
  author = {Antoine Limasset and Guillaume Rizk and Rayan Chikhi and Pierre Peterlongo},
  year   = {2017},
  eprint = {1702.03154},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1702.03154}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1702.03154.svg)](https://codeofpaper.com/paper/1702.03154)

Discussion