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 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 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 bits per key of the space of PHast, using 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 on this fraction, and we estimate that the best placement bumps about of the keys, which is about on tenth of the keys bumped by PHastR.

生成讲解博客的中文版本

生成AI智能校验的中文版本