Non-minimal k-perfect hashing: Tight lower bounds and an application to fast static hash tables
Abstract
A minimal perfect hash function (minimal PHF) is a data structure mapping a static set of keys to bins without collisions. Two natural generalizations are minimal -PHFs where keys are mapped to bins of capacity each, and (non-minimal) PHFs with load factor where the number of bins is increased by a factor of , resulting in spare capacity. While there has been a recent surge of interest in perfect hashing generally, non-minimal -PHFs have not been systematically studied despite a natural use case of speeding up static hash tables: The idea is that a small cache-resident -PHF maps each key to a cache-line-sized bin of capacity where resides. Ideally, this yields a branchless lookup operation with a single cache miss working at high load factors for positive and negative queries alike. Our main theoretical contribution is to determine tight space lower bounds for -PHFs for all pairs of and . It turns out that combining and drastically reduces the space of -PHFs, e.g. for the space lower bound is bits per key while for and the lower bounds are higher by factors of and , respectively. On the practical side, we develop a -PHF based on PtrHash and tune it for use in static hash tables. Empirically, our implementation produces -PHFs of size roughly above the lower bound. A static hash set based on this -PHF is consistently at least as fast as other hash sets for negative and mixed queries. On two of the three tested architectures it achieves up to speedup for large where a -PHF does not fit in cache.
Cite
@article{arxiv.2607.07257,
title = {Non-minimal k-perfect hashing: Tight lower bounds and an application to fast static hash tables},
author = {Ragnar Groot Koerkamp and Stefan Hermann and Peter Sanders and Stefan Walzer},
journal= {arXiv preprint arXiv:2607.07257},
year = {2026}
}
Comments
Accepted to ESA 2026; 27 pages; 7 figures