PHastR: Faster Minimal Perfect Hashing with Rotated Layouts
Abstract: We present PHastR, a minimal perfect hash function of the PHast family. Like PHast+, the fast-to-build variant of PHast, PHastR finds feasible seeds with bit-parallel operations: its seeds move keys along rings of slots, and to evaluate the seeds of a bucket it cyclically shifts, for each key, a word recording which slots of its ring are used. Unlike PHast+, however, it avoids self-collisions, which make two keys of a bucket collide for (almost) all its seeds: more than a third of the buckets bumped by PHast+ with wrapping and multiplier 3 contain one. With 8-bit seeds, PHastR uses $1.94$ bits per key, the same space as the best variant of PHast+ with wrapping, but it is built in of the time, and its queries are faster on $109$ keys, as it bumps of the keys instead of ; they are faster also than those of PHast, which takes eleven times as long to build, and about as fast as those of PtrHash, which uses more than one bit per key more. With a larger expected bucket size PHastR comes within $0.02$ bits per key of the space of PHast, using $1.90$ bits per key, and still has faster queries. Its construction also scales better with the number of threads: with all the threads of a 48-core machine it is almost three times faster than that of PHast+. Finally, we argue that when each key can be placed only within a range of slots, every placement of random keys on slots, however found, must bump on large key sets a constant fraction of the keys: we derive a lower bound of about $0.1/W$ on this fraction, and we estimate that the best placement bumps about $1/2W$ of the keys, which is about on tenth of the keys bumped by PHastR.
Paper Prompts
Sign up for free to create and run prompts on this paper.